fix main process env bug

This commit is contained in:
yi-ge 2021-07-08 22:44:44 +08:00
parent 72f4b11854
commit 0d0037e889
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ const argv = minimist(process.argv.slice(2))
const opts = options(argv.env) const opts = options(argv.env)
const TAG = '[build-main.ts]' const TAG = '[build-main.ts]'
const spinner = ora(`${TAG} Electron build...`) const spinner = ora(`${TAG} Electron build...`)
process.env.NODE_ENV = argv.env
if (argv.watch) { if (argv.watch) {
waitOn({ port: process.env.PORT as string }).then(msg => { waitOn({ port: process.env.PORT as string }).then(msg => {

2
typings/global.d.ts vendored
View File

@ -1,7 +1,7 @@
declare namespace NodeJS { declare namespace NodeJS {
interface ProcessEnv { interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' NODE_ENV: 'development' | 'production'
readonly PORT: string readonly PORT: string
} }
} }