From a086760601fa18e1aecc3a85c4f4b8173384f020 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Fri, 24 May 2019 18:10:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8Cclose=20#3118?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/plugin.ts | 3 ++- packages/taro-cli/src/util/resolve_npm_files.ts | 1 - packages/taro-cli/templates/wxplugin/index.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/taro-cli/src/plugin.ts b/packages/taro-cli/src/plugin.ts index 61c7c1af640a..c131a820acce 100644 --- a/packages/taro-cli/src/plugin.ts +++ b/packages/taro-cli/src/plugin.ts @@ -46,7 +46,6 @@ const PLUGIN_MOCK_JSON = 'plugin-mock.json' let isCopyingFiles = {} export async function build (appPath: string, { watch, platform }: IBuildConfig) { - setIsProduction(process.env.NODE_ENV === 'production' || !watch) switch (platform) { case BUILD_TYPES.WEAPP: buildWxPlugin(appPath, { watch }) @@ -320,6 +319,8 @@ async function buildWxPlugin (appPath, { watch }) { const docDir = path.join(pluginDir, DOC_ROOT) const docPath = path.join(appPath, DOC_ROOT) + setIsProduction(process.env.NODE_ENV === 'production' || !watch) + fs.existsSync(pluginPath) && Util.emptyDirectory(pluginPath) fs.existsSync(docPath) && Util.emptyDirectory(docPath) // 编译调试项目 diff --git a/packages/taro-cli/src/util/resolve_npm_files.ts b/packages/taro-cli/src/util/resolve_npm_files.ts index 878fe64cc2cc..0d9e662c1f16 100644 --- a/packages/taro-cli/src/util/resolve_npm_files.ts +++ b/packages/taro-cli/src/util/resolve_npm_files.ts @@ -22,7 +22,6 @@ import { REG_TYPESCRIPT, BUILD_TYPES, REG_STYLE, - REG_SCRIPTS, REG_FONT, REG_IMAGE, REG_MEDIA, diff --git a/packages/taro-cli/templates/wxplugin/index.js b/packages/taro-cli/templates/wxplugin/index.js index a6565bb57a24..bf134447fb4a 100644 --- a/packages/taro-cli/templates/wxplugin/index.js +++ b/packages/taro-cli/templates/wxplugin/index.js @@ -215,7 +215,6 @@ module.exports = function (creater, params, helper, cb) { if (code === 0) { installSpinner.color = 'green' installSpinner.succeed('安装成功') - console.log(`${install.stderr.read()}${install.stdout.read()}`) } else { installSpinner.color = 'red' installSpinner.fail(chalk.red('安装项目依赖失败,请自行重新安装!'))