Skip to content

Commit

Permalink
fix(taro-cli): fix taro cli default clean path (#2130)
Browse files Browse the repository at this point in the history
修改taro-cli编译开始时,需要清理的dist路径,要与工程里的config配置的输出路径保持一致,不能写死成dist
  • Loading branch information
pamler authored and luckyadam committed Feb 14, 2019
1 parent 14b5b71 commit ddfb51c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/taro-cli/src/build.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const fs = require('fs-extra')
const path = require('path')
const chalk = require('chalk')
const _ = require('lodash')

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 outputPath = path.join(appPath, CONFIG.OUTPUT_DIR)
const outputPath = path.join(appPath, configDir.outputRoot || CONFIG.OUTPUT_DIR)
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath)
} else {
Expand Down

0 comments on commit ddfb51c

Please sign in to comment.