feat: add inspector node debug support

This commit is contained in:
oceanlvr
2022-02-14 17:48:27 +08:00
parent f0424cbc4c
commit 9c902494a1
6 changed files with 68 additions and 18 deletions

View File

@@ -23,7 +23,7 @@ async function createWindow() {
},
})
if (app.isPackaged) {
if (app.isPackaged || process.env["DEBUG"]) {
win.loadFile(join(__dirname, '../renderer/index.html'))
} else {
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin

View File

@@ -11,7 +11,7 @@ export default defineConfig({
formats: ['cjs'],
fileName: () => '[name].cjs',
},
minify: false,
minify: process.env./* from mode option */NODE_ENV === 'production',
sourcemap: true,
emptyOutDir: true,
rollupOptions: {

View File

@@ -11,6 +11,7 @@ export default defineConfig({
formats: ['cjs'],
fileName: () => '[name].cjs',
},
sourcemap: true,
minify: process.env./* from mode option */NODE_ENV === 'production',
emptyOutDir: true,
rollupOptions: {

View File

@@ -25,6 +25,7 @@ export default defineConfig({
base: './',
build: {
emptyOutDir: true,
sourcemap: true,
outDir: '../../dist/renderer',
},
server: {