From 6c8e2e53c5cca6226a5dc1509f6ca26f509fcbd7 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Wed, 20 Feb 2019 18:24:19 -0800 Subject: [PATCH] Use contenthash instead of chunkhash for better long-term caching (#6387) --- packages/react-scripts/config/webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index a3e31b14824..f6c0e7a237a 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -161,11 +161,11 @@ module.exports = function(webpackEnv) { // There will be one main bundle, and one file per asynchronous chunk. // In development, it does not produce real files. filename: isEnvProduction - ? 'static/js/[name].[chunkhash:8].js' + ? 'static/js/[name].[contenthash:8].js' : isEnvDevelopment && 'static/js/bundle.js', // There are also additional JS chunk files if you use code splitting. chunkFilename: isEnvProduction - ? 'static/js/[name].[chunkhash:8].chunk.js' + ? 'static/js/[name].[contenthash:8].chunk.js' : isEnvDevelopment && 'static/js/[name].chunk.js', // We inferred the "public path" (such as / or /my-project) from homepage. // We use "/" in development.