fix: ensure correct process.env.NODE_ENV
This commit is contained in:
parent
1509250f92
commit
a02c7c71fe
|
@ -17,6 +17,7 @@ const pkg = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8')
|
||||||
function getWatcher({ name, configFile, writeBundle }) {
|
function getWatcher({ name, configFile, writeBundle }) {
|
||||||
return viteBuild({
|
return viteBuild({
|
||||||
// Options here precedence over configFile
|
// Options here precedence over configFile
|
||||||
|
mode: process.env.NODE_ENV,
|
||||||
build: {
|
build: {
|
||||||
watch: {},
|
watch: {},
|
||||||
},
|
},
|
||||||
|
@ -46,7 +47,7 @@ async function watchMain() {
|
||||||
electronProcess && electronProcess.kill()
|
electronProcess && electronProcess.kill()
|
||||||
electronProcess = spawn(electron, ['.'], {
|
electronProcess = spawn(electron, ['.'], {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
env: Object.assign(process.env, pkg.env), // Why don't work?
|
env: Object.assign(process.env, pkg.env),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue