Skip to content

Commit

Permalink
fix(cli): configDir引入前置导致config/index获取process.env.NODE_ENV为undefined…
Browse files Browse the repository at this point in the history
….模板为例子,配置只输出production环境 (#2211)
  • Loading branch information
lms-sam authored and luckyadam committed Feb 20, 2019
1 parent adff287 commit fe8c12e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-cli/src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ const Util = require('./util')
const CONFIG = require('./config')

const appPath = process.cwd()
const configDir = require(path.join(appPath, Util.PROJECT_CONFIG))(_.merge)


function build (args, buildConfig) {
const { type, watch } = buildConfig
const configDir = require(path.join(appPath, Util.PROJECT_CONFIG))(_.merge)
const outputPath = path.join(appPath, configDir.outputRoot || CONFIG.OUTPUT_DIR)
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath)
Expand Down

0 comments on commit fe8c12e

Please sign in to comment.