diff options
author | Yukai Huang | 2016-11-02 11:25:21 +0800 |
---|---|---|
committer | Yukai Huang | 2016-11-02 11:25:21 +0800 |
commit | 971bfe29f8a4e1004f039b21fb4bbc3972fd8a16 (patch) | |
tree | 8a32eb8ea1aefedd4c7dbb391b799e1b69d9f621 | |
parent | cd5977cd5f39ffbe4d1ab5afac0dd895a6b0f6ee (diff) |
Config webpack css hash in production
-rw-r--r-- | webpack.config.js | 7 | ||||
-rw-r--r-- | webpack.production.js | 4 | ||||
-rw-r--r-- | webpackBaseConfig.js | 1 |
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, |