chore: UPDATE comment

This commit is contained in:
草鞋没号 2021-11-29 11:31:21 +08:00
parent 76660bbd6c
commit 2760856314

View File

@ -16,7 +16,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({
// Fix form 'vite-main.config.ts' and 'vite-preload.config.ts' // Ensure `vite-main.config.ts` and `vite-preload.config.ts` correct `process.env.NODE_ENV`
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
// Options here precedence over configFile // Options here precedence over configFile
build: { build: {
@ -48,7 +48,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),
}) })
}, },
}) })