summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYukai Huang2016-11-02 11:25:21 +0800
committerYukai Huang2016-11-02 11:25:21 +0800
commit971bfe29f8a4e1004f039b21fb4bbc3972fd8a16 (patch)
tree8a32eb8ea1aefedd4c7dbb391b799e1b69d9f621
parentcd5977cd5f39ffbe4d1ab5afac0dd895a6b0f6ee (diff)
Config webpack css hash in production
-rw-r--r--webpack.config.js7
-rw-r--r--webpack.production.js4
-rw-r--r--webpackBaseConfig.js1
3 files changed, 9 insertions, 3 deletions
diff --git a/webpack.config.js b/webpack.config.js
index d2cf3dc7..6a436f43 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,3 +1,8 @@
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")
+ ])
+});
diff --git a/webpack.production.js b/webpack.production.js
index 5fe6f294..1a55e615 100644
--- a/webpack.production.js
+++ b/webpack.production.js
@@ -1,6 +1,7 @@
var baseConfig = require('./webpackBaseConfig');
var webpack = require('webpack');
var path = require('path');
+var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = Object.assign({}, baseConfig, {
plugins: baseConfig.plugins.concat([
@@ -15,7 +16,8 @@ module.exports = Object.assign({}, baseConfig, {
},
mangle: false,
sourceMap: false
- })
+ }),
+ new ExtractTextPlugin("[name].[hash].css")
]),
output: {
diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js
index 4cc943dc..560635ca 100644
--- a/webpackBaseConfig.js
+++ b/webpackBaseConfig.js
@@ -15,7 +15,6 @@ module.exports = {
"moment": "moment",
"Handlebars": "handlebars"
}),
- new ExtractTextPlugin("[name].css"),
new webpack.optimize.CommonsChunkPlugin({
names: ["cover", "index", "pretty", "slide", "vendor"],
children: true,