Skip to content

Commit

Permalink
fixed to use babel-preset-env - #407
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed Sep 29, 2017
1 parent 40d0325 commit 63623c1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/wepy-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wepy-cli",
"version": "1.5.9-0",
"version": "1.5.9-1",
"description": "",
"main": "bin/wepy.js",
"bin": {
Expand Down
8 changes: 6 additions & 2 deletions packages/wepy-cli/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ const utils = {
},
error (msg) {
this.log(msg, 'error', false);
if (!util.isWatch) {
if (!this.isWatch) {
process.exit(0);
}
},
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions packages/wepy-cli/src/wepy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions packages/wepy-cli/templates/empty/wepy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand Down
4 changes: 2 additions & 2 deletions packages/wepy-cli/templates/template/wepy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 63623c1

Please sign in to comment.