Skip to content

Commit

Permalink
Add hash to bundle filenames
Browse files Browse the repository at this point in the history
Add a hash to generated JS & CSS bundle filenames.
  • Loading branch information
soroushj committed Nov 28, 2017
1 parent 7be1b5e commit 6f7b98a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "A light foundation for your next frontend project based on webpack.",
"scripts": {
"prebuild": "rimraf dist",
"build": "webpack --config webpack-prod.config.js --colors",
"dev": "webpack-dev-server --open --config webpack-dev.config.js --watch --colors"
},
Expand Down Expand Up @@ -47,6 +48,7 @@
"extract-text-webpack-plugin": "^3.0.0",
"html-webpack-plugin": "^2.17.0",
"node-sass": "^4.1.1",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"webpack": "^3.5.6",
Expand Down
4 changes: 2 additions & 2 deletions webpack.config-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Path = require('path');
const Webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ExtractSASS = new ExtractTextPlugin('styles/bundle.css');
const ExtractSASS = new ExtractTextPlugin('styles/bundle.[hash].css');

module.exports = (options) => {
const dest = Path.join(__dirname, 'dist');
Expand All @@ -16,7 +16,7 @@ module.exports = (options) => {
],
output: {
path: dest,
filename: 'bundle.js'
filename: 'bundle.[hash].js'
},
plugins: [
new Webpack.DefinePlugin({
Expand Down

0 comments on commit 6f7b98a

Please sign in to comment.