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