Add hash to index.js to disable the cache

This commit is contained in:
Yanbing Zhao 2018-02-07 08:14:47 +08:00
parent 89f705fe24
commit c57ec4d4c9
2 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,7 @@
"babel-loader": "^7.1.2",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"clean-webpack-plugin": "^0.1.18",
"css-loader": "^0.28.9",
"html-webpack-plugin": "^2.30.1",
"style-loader": "^0.20.1",

View File

@ -3,12 +3,13 @@ var path = require('path')
var DefinePlugin = require('webpack').DefinePlugin
var HtmlWebpackPlugin = require('html-webpack-plugin')
var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
var CleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
path: path.join(__dirname, './build'),
filename: 'index.js'
filename: 'index.[hash:8].js'
},
module: {
loaders: [{
@ -22,7 +23,9 @@ module.exports = {
loader: 'url-loader?limit=65535'
}]
},
plugins: [new HtmlWebpackPlugin({
plugins: [new CleanWebpackPlugin([
'build/index.*.js'
]), new HtmlWebpackPlugin({
template: './src/index.html',
minify: {collapseWhitespace: true}
}), new DefinePlugin({