taro-cli/src/build.js的configDir引入前置导致config/index获取process.env.NODE_ENV为undefined #2211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述
configDir引入前置导致config/index获取process.env.NODE_ENV为undefined.模板为例子,配置只输出production环境
复现步骤
npm run build:weapp
npm run dev:weapp
配置只输出production配置
// 这里可以贴代码
期望行为
对应命令钩子输出对应构建配置
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
Taro CLI 1.2.13 environment info:
System:
OS: macOS 10.14
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.1.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
补充信息
[可选]
下面有修改代码