Config webpack css hash in production

This commit is contained in:
Yukai Huang 2016-11-02 11:25:21 +08:00
parent cd5977cd5f
commit 971bfe29f8
3 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
var baseConfig = require('./webpackBaseConfig'); var baseConfig = require('./webpackBaseConfig');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = baseConfig; module.exports = Object.assign({}, baseConfig, {
plugins: baseConfig.plugins.concat([
new ExtractTextPlugin("[name].css")
])
});

View file

@ -1,6 +1,7 @@
var baseConfig = require('./webpackBaseConfig'); var baseConfig = require('./webpackBaseConfig');
var webpack = require('webpack'); var webpack = require('webpack');
var path = require('path'); var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = Object.assign({}, baseConfig, { module.exports = Object.assign({}, baseConfig, {
plugins: baseConfig.plugins.concat([ plugins: baseConfig.plugins.concat([
@ -15,7 +16,8 @@ module.exports = Object.assign({}, baseConfig, {
}, },
mangle: false, mangle: false,
sourceMap: false sourceMap: false
}) }),
new ExtractTextPlugin("[name].[hash].css")
]), ]),
output: { output: {

View file

@ -15,7 +15,6 @@ module.exports = {
"moment": "moment", "moment": "moment",
"Handlebars": "handlebars" "Handlebars": "handlebars"
}), }),
new ExtractTextPlugin("[name].css"),
new webpack.optimize.CommonsChunkPlugin({ new webpack.optimize.CommonsChunkPlugin({
names: ["cover", "index", "pretty", "slide", "vendor"], names: ["cover", "index", "pretty", "slide", "vendor"],
children: true, children: true,