webpack config

This commit is contained in:
cookfront
2017-03-24 15:36:55 +08:00
parent b39b4547a8
commit bb85b3416c
14 changed files with 72 additions and 46 deletions

View File

@@ -1,3 +1,5 @@
var webpack = require('webpack');
var getPostcssPlugin = require('./utils/postcss_pipe');
var config = require('./webpack.config.js');
config.entry = {
@@ -14,6 +16,28 @@ config.externals = {
vue: 'vue'
};
config.plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
options: {
postcss: getPostcssPlugin,
babel: {
presets: ['es2015'],
plugins: ['transform-runtime', 'transform-vue-jsx']
},
vue: {
autoprefixer: false,
preserveWhitespace: false,
postcss: getPostcssPlugin
}
}
})
];
delete config.devtool;
module.exports = config;