From e24cfeb840b518df3acdd88d25102c39a599f471 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 7 Nov 2022 12:00:29 +0000 Subject: [PATCH] Ensure chunk filenames are consistent for long-term caching Per https://webpack.js.org/configuration/output/#template-strings, `contenthash` is based on the final content of the chunk file. Given the same file contents, the filename is guaranteed to be the same. Resolves https://github.com/ef4/ember-auto-import/issues/519 --- packages/ember-auto-import/ts/webpack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ember-auto-import/ts/webpack.ts b/packages/ember-auto-import/ts/webpack.ts index 43b1636e..bf2fd54e 100644 --- a/packages/ember-auto-import/ts/webpack.ts +++ b/packages/ember-auto-import/ts/webpack.ts @@ -154,8 +154,8 @@ export default class WebpackBundler extends Plugin implements Bundler { output: { path: join(this.outputPath, 'assets'), publicPath: this.opts.publicAssetURL, - filename: `chunk.[id].[chunkhash].js`, - chunkFilename: `chunk.[id].[chunkhash].js`, + filename: `chunk.[id].[contenthash].js`, + chunkFilename: `chunk.[id].[contenthash].js`, libraryTarget: 'var', library: '__ember_auto_import__', },