Commit f3b6b3d5 authored by Evan You's avatar Evan You

only extract for production

parent 68cdaa80
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
loaders: {
loaders: isProd ? {
stylus: ExtractTextPlugin.extract({
use: 'css-loader!stylus-loader',
use: 'css-loader?minimize!stylus-loader',
fallback: 'vue-style-loader'
})
},
} : {},
preserveWhitespace: false,
postcss: [
require('autoprefixer')({
......
......@@ -50,9 +50,16 @@ module.exports = {
maxEntrypointSize: 300000,
hints: isProd ? 'warning' : false
},
plugins: [
new ExtractTextPlugin({ filename: 'common.[chunkhash].css' })
].concat(isProd
? [new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }})]
: [new FriendlyErrorsPlugin()])
plugins: isProd
? [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new ExtractTextPlugin({
filename: 'common.[chunkhash].css'
})
]
: [
new FriendlyErrorsPlugin()
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment