Skip to content

Commit

Permalink
upgrade config
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed Dec 16, 2016
1 parent 49f4181 commit efc23ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
"babel-preset-stage-1": "^6.16.0",
"babel-runtime": "^6.18.0",
"wepy": "^1.1.5"
},
"devDependencies": {
"wepy-compiler-babel": "0.0.3",
"wepy-compiler-sass": "0.0.3"
}
}
63 changes: 30 additions & 33 deletions wepy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,40 @@
let prod = process.env.NODE_ENV === 'production';

module.exports = {
"wpyExt": ".wpy",
"sass": {
"outputStyle": "compressed"
},
"less": {
"compress": true
},
"babel": {
"presets": [
"es2015",
"stage-1"
],
"plugins": [
"transform-export-extensions",
"syntax-export-extensions",
"transform-runtime"
]
}
"wpyExt": ".wpy",
"compilers": {
"sass": {
"outputStyle": "compressed"
},
babel: {
"presets": [
"es2015",
"stage-1"
],
"plugins": [
"transform-export-extensions",
"syntax-export-extensions",
"transform-runtime"
]
}
}
};


if (prod) {
// 压缩sass
module.exports['sass'] = {"outputStyle": "compressed"};
// 压缩sass
module.exports['sass'] = {"outputStyle": "compressed"};

// 压缩less
module.exports['less'] = {"compress": true};

// 压缩js
module.exports.plugins = {
'UglifyJsPlugin': {
filter: /\.js$/,
config: {
compress: {
warnings: false
}
}
}
};
// 压缩js
module.exports.plugins = {
'UglifyJsPlugin': {
filter: /\.js$/,
config: {
compress: {
warnings: false
}
}
}
};
}

0 comments on commit efc23ac

Please sign in to comment.