rename .debug.script.mjs, .debug.env
This commit is contained in:
parent
c8b69d7d13
commit
cd0fceb033
|
@ -7,7 +7,7 @@ import { build, createServer } from 'vite'
|
|||
const pkg = createRequire(import.meta.url)('../package.json')
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
async function startDebug() {
|
||||
async function buildDebugApp() {
|
||||
const server = await createServer({ configFile: 'packages/renderer/vite.config.ts' })
|
||||
|
||||
await server.listen()
|
||||
|
@ -39,9 +39,9 @@ async function startDebug() {
|
|||
|
||||
function writeEnvLocal() {
|
||||
const envContent = Object.entries(pkg.env).map(([key, val]) => `${key}=${val}`)
|
||||
fs.writeFileSync(path.join(__dirname, '.env'), envContent.join('\n'))
|
||||
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
|
||||
}
|
||||
|
||||
// bootstrap
|
||||
writeEnvLocal()
|
||||
startDebug()
|
||||
buildDebugApp()
|
|
@ -6,7 +6,7 @@
|
|||
"compounds": [
|
||||
{
|
||||
"name": "Debug App",
|
||||
"preLaunchTask": "start debug.script.mjs",
|
||||
"preLaunchTask": "start .debug.script.mjs",
|
||||
"configurations": [
|
||||
"Debug Main Process",
|
||||
"Debug Renderer Process"
|
||||
|
@ -32,7 +32,7 @@
|
|||
"--remote-debugging-port=9229",
|
||||
"${workspaceRoot}/dist/main/index.cjs"
|
||||
],
|
||||
"envFile": "${workspaceFolder}/.vscode/.env"
|
||||
"envFile": "${workspaceFolder}/.vscode/.debug.env"
|
||||
},
|
||||
{
|
||||
"name": "Debug Renderer Process",
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "start debug.script.mjs",
|
||||
"label": "start .debug.script.mjs",
|
||||
"command": "node",
|
||||
"args": [
|
||||
".vscode/debug.script.mjs"
|
||||
".vscode/.debug.script.mjs"
|
||||
],
|
||||
"isBackground": true,
|
||||
"problemMatcher": []
|
||||
|
|
Loading…
Reference in New Issue