From cd7366498a1af9f887d72902ef3acab6fb2817b7 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Fri, 30 Aug 2024 14:29:25 +0300 Subject: [PATCH] Management (next): fix chunk load error --- packages/next-management/next.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/next-management/next.config.js b/packages/next-management/next.config.js index 1db4355465..1d0ea21d25 100644 --- a/packages/next-management/next.config.js +++ b/packages/next-management/next.config.js @@ -41,7 +41,7 @@ const nextConfig = { }, generateBuildId: async () => { // This could be anything, using the latest git hash - return `${pkg.name} - ${pkg.version} `; + return `${pkg.name}-${pkg.version}-${new Date().getTime()}`; }, images: { unoptimized: true, @@ -157,6 +157,12 @@ module.exports = { // Modify the file loader rule to ignore *.svg, since we have it handled now. fileLoaderRule.exclude = /\.svg$/i; + if (config?.output?.filename) + config.output.filename = config.output.filename?.replace( + "[chunkhash]", + `[contenthash]`, + ); + return config; }, ...nextConfig,