Skip to content

Commit

Permalink
fix(cli): 修复 build 命令对 env 参数的支持,fix #6441
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed May 25, 2020
1 parent 92d0cc4 commit 6cf8aab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/taro-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class CLI {
platform: args.type,
isWatch: !!args.watch,
port: args.port,
env: args.env,
release: args.release,
ui: args.ui,
uiIndex: args.uiIndex,
Expand Down
4 changes: 3 additions & 1 deletion packages/taro-cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function build (kernel: Kernel, {
isWatch,
release,
port,
env,
ui,
uiIndex,
page,
Expand All @@ -17,6 +18,7 @@ export default function build (kernel: Kernel, {
isWatch: boolean,
release?: boolean
port?: number
env?: string
ui?: boolean
uiIndex?: string
page?: string
Expand All @@ -37,7 +39,7 @@ export default function build (kernel: Kernel, {
if (ui) {
platform = 'ui'
}
let nodeEnv = process.env.NODE_ENV
let nodeEnv = process.env.NODE_ENV || env
if (!nodeEnv) {
if (isWatch) {
nodeEnv = 'development'
Expand Down

0 comments on commit 6cf8aab

Please sign in to comment.