diff --git a/packages/wepy-cli/package.json b/packages/wepy-cli/package.json index a422ca1bb..1ba6153a0 100644 --- a/packages/wepy-cli/package.json +++ b/packages/wepy-cli/package.json @@ -1,6 +1,6 @@ { "name": "wepy-cli", - "version": "1.5.9-0", + "version": "1.5.9-1", "description": "", "main": "bin/wepy.js", "bin": { diff --git a/packages/wepy-cli/src/util.js b/packages/wepy-cli/src/util.js index 3fcc3a99e..27c9b5c2b 100644 --- a/packages/wepy-cli/src/util.js +++ b/packages/wepy-cli/src/util.js @@ -516,7 +516,7 @@ const utils = { }, error (msg) { this.log(msg, 'error', false); - if (!util.isWatch) { + if (!this.isWatch) { process.exit(0); } }, @@ -531,7 +531,11 @@ const utils = { if(type && this.isString(type)) { type = type.toUpperCase(); if(type === 'ERROR'){ - console.error(colors.red('[Error] ' + msg)); + if (msg instanceof Error) { + console.error(colors.red('[Error] ' + msg.stack)); + } else { + console.error(colors.red('[Error] ' + msg)); + } } else if(type === 'WARNING'){ console.error(colors.yellow('[WARNING] ' + msg)); } else { diff --git a/packages/wepy-cli/src/wepy.js b/packages/wepy-cli/src/wepy.js index 81d105a67..32e5fc8ea 100644 --- a/packages/wepy-cli/src/wepy.js +++ b/packages/wepy-cli/src/wepy.js @@ -67,9 +67,9 @@ let generateProject = (name, config) => { 'babel-plugin-transform-decorators-legacy', 'babel-plugin-syntax-export-extensions', 'babel-plugin-transform-export-extensions', - 'babel-preset-es2015', + 'babel-plugin-transform-class-properties', + 'babel-preset-env', 'wepy-compiler-less', - 'babel-preset-stage-1', 'cross-env' ]; const eslintDeps = [ diff --git a/packages/wepy-cli/templates/empty/wepy.config.js b/packages/wepy-cli/templates/empty/wepy.config.js index d1cf30d5e..f4fad719c 100644 --- a/packages/wepy-cli/templates/empty/wepy.config.js +++ b/packages/wepy-cli/templates/empty/wepy.config.js @@ -13,10 +13,10 @@ module.exports = { babel: { 'sourceMap': true, 'presets': [ - 'es2015', - 'stage-1' + 'env' ], 'plugins': [ + 'babel-plugin-transform-class-properties', 'transform-export-extensions', 'syntax-export-extensions' ] diff --git a/packages/wepy-cli/templates/template/wepy.config.js b/packages/wepy-cli/templates/template/wepy.config.js index b0ec3dc50..2788bdd78 100644 --- a/packages/wepy-cli/templates/template/wepy.config.js +++ b/packages/wepy-cli/templates/template/wepy.config.js @@ -27,10 +27,10 @@ module.exports = { babel: { sourceMap: true, presets: [ - 'es2015', - 'stage-1' + 'env' ], plugins: [ + 'babel-plugin-transform-class-properties', 'transform-decorators-legacy', 'transform-export-extensions', 'syntax-export-extensions'