Skip to content

Commit

Permalink
Live Preview: Add the contenthash to the chunk file to resolve the ca…
Browse files Browse the repository at this point in the history
…che issue (#86691)
  • Loading branch information
arthur791004 authored Jan 24, 2024
1 parent a1cf778 commit e563438
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/wpcom-block-editor/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const shouldEmitStats = process.env.EMIT_STATS && process.env.EMIT_STATS !== 'fa
* @param {Object} argv.entry Entry point(s)
* @param {string} argv.outputPath Output path
* @param {string} argv.outputFilename Output filename pattern
* @param {string} argv.outputChunkFilename Output chunk filename pattern
* @returns {Object} webpack config
*/
function getWebpackConfig(
Expand All @@ -41,10 +42,12 @@ function getWebpackConfig(
},
outputPath = path.join( __dirname, 'dist' ),
outputFilename = isDevelopment ? '[name].js' : '[name].min.js',
outputChunkFilename = isDevelopment ? '[name]-[contenthash].js' : '[name]-[contenthash].min.js',
}
) {
const webpackConfig = getBaseWebpackConfig( env, {
entry,
'output-chunk-filename': outputChunkFilename,
'output-filename': outputFilename,
'output-path': outputPath,
} );
Expand Down

0 comments on commit e563438

Please sign in to comment.