-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02bf3cf
commit 69988f9
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "npm run vscode:debug", | ||
// "env": { "NO_COLOR": "1" }, // If terminal does not display ANSI escapes | ||
"internalConsoleOptions": "openOnFirstSessionStart", | ||
"name": "Neu React Vite Runner", | ||
"request": "launch", | ||
"type": "node-terminal", | ||
"serverReadyAction": { | ||
"action": "debugWithChrome", | ||
"killOnServerStop": true, | ||
"pattern": "Local:.*http://localhost:([0-9]+)/", | ||
"uriFormat": "http://localhost:%s", | ||
"webRoot": "${workspaceFolder}${pathSeparator}react-src" | ||
}, | ||
"postDebugTask": "npm: vscode:postdebug" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const { spawn } = require('child_process'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const neuConfig = require('../neutralino.config.json'); | ||
|
||
const root = path.join(__dirname, '..'); | ||
|
||
const patchFile = path.join(root, neuConfig.cli.frontendLibrary.patchFile); | ||
const patchFileExists = fs.existsSync(patchFile); | ||
const backupPatchFile = path.join(path.dirname(patchFile), 'index.org.html'); | ||
const backupPatchFileExists = fs.existsSync(backupPatchFile); | ||
|
||
const restorePatchFile = () => { | ||
fs.rmSync(patchFile); | ||
fs.renameSync(backupPatchFile, patchFile); | ||
}; | ||
|
||
if (process.argv.includes('--postdebug')) { | ||
if (backupPatchFileExists) restorePatchFile(); | ||
} else { | ||
if (patchFileExists) fs.cpSync(patchFile, backupPatchFile); | ||
spawn( | ||
'npx', | ||
['@neutralinojs/neu', 'run', '--', '--mode=cloud'], | ||
// | ||
// Cloud mode is a convenience to avoid the window popup. The NL_TOKEN is | ||
// not consumed until the debugger attaches; all other clients are rejected | ||
// | ||
{ | ||
cwd: path.join(root), | ||
stdio: 'inherit', | ||
shell: true, | ||
} | ||
); | ||
} |