Skip to content

Instantly share code, notes, and snippets.

@ryanwilsonperkin
Created February 23, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanwilsonperkin/350164cb36c31eb53499af453b123a71 to your computer and use it in GitHub Desktop.
Save ryanwilsonperkin/350164cb36c31eb53499af453b123a71 to your computer and use it in GitHub Desktop.
Webpack: chunkhash in production, hash in development
const PRODUCTION = process.env.NODE_ENV === 'production';
const HASH_MODE = PRODUCTION ? 'chunkhash' : 'hash';
module.exports = {
output: {
filename: `[name].[${HASH_MODE}].js`,
chunkFilename: `[name].[${HASH_MODE}].js`,
},
...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment