From efc23ac99b97260641d09460b72b1cb69d4647f4 Mon Sep 17 00:00:00 2001 From: Gcaufy <gcaufy@gmail.com> Date: Fri, 16 Dec 2016 12:35:57 +0800 Subject: [PATCH] upgrade config --- package.json | 4 ++++ wepy.config.js | 63 ++++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 37ca09e..4452b99 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/wepy.config.js b/wepy.config.js index 7602d4e..c8571bf 100644 --- a/wepy.config.js +++ b/wepy.config.js @@ -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 + } + } + } + }; } \ No newline at end of file