Merge pull request #15 from yi-ge/main

Fix main process env bug
This commit is contained in:
草鞋没号 2021-07-09 08:53:09 +08:00 committed by GitHub
commit c94327f87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
} }
} }