Skip to content

Commit

Permalink
feat: add contenthash during prod build
Browse files Browse the repository at this point in the history
  • Loading branch information
swashata committed Dec 3, 2018
1 parent ddf5af1 commit 1cbb309
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/scripts/src/config/WebpackConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ export class WebpackConfigHelper {
// We do not use path.resolve, because we expect outputPath to be
// relative. @todo: create a test here
path: this.outputPath,
filename: `${this.appDir}/[name].js`,
filename: `${this.appDir}/${
this.isDev ? '[name]' : '[name]-[contenthash:8]'
}.js`,
// leave blank because we would handle with free variable
// __webpack_public_path__ in runtime.
publicPath: '',
Expand Down Expand Up @@ -254,7 +256,9 @@ export class WebpackConfigHelper {
}),
// Initiate mini css extract
new miniCssExtractPlugin({
filename: `${this.appDir}/[name].css`,
filename: `${this.appDir}/${
this.isDev ? '[name]' : '[name]-[contenthash:8]'
}.css`,
}),
// Create Manifest for PHP Consumption
new WebpackAssetsManifest({
Expand Down

0 comments on commit 1cbb309

Please sign in to comment.