From ddfb51ca6aa6ea568a60f26d5c369b7b934334c2 Mon Sep 17 00:00:00 2001 From: Pamler Date: Thu, 14 Feb 2019 16:17:37 +0800 Subject: [PATCH] fix(taro-cli): fix taro cli default clean path (#2130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改taro-cli编译开始时,需要清理的dist路径,要与工程里的config配置的输出路径保持一致,不能写死成dist --- packages/taro-cli/src/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/src/build.js b/packages/taro-cli/src/build.js index ac1d01da1d0e..2acb3a32d567 100644 --- a/packages/taro-cli/src/build.js +++ b/packages/taro-cli/src/build.js @@ -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 {