Skip to content

Commit

Permalink
fix(cli): 修复插件编译报错的问题,close #3118
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed May 24, 2019
1 parent 3f847bb commit a086760
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/taro-cli/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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)
// 编译调试项目
Expand Down
1 change: 0 additions & 1 deletion packages/taro-cli/src/util/resolve_npm_files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
REG_TYPESCRIPT,
BUILD_TYPES,
REG_STYLE,
REG_SCRIPTS,
REG_FONT,
REG_IMAGE,
REG_MEDIA,
Expand Down
1 change: 0 additions & 1 deletion packages/taro-cli/templates/wxplugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('安装项目依赖失败,请自行重新安装!'))
Expand Down

0 comments on commit a086760

Please sign in to comment.