Management (next): fix chunk load error

This commit is contained in:
Viktor Fomin 2024-08-30 14:29:25 +03:00
parent 3872099471
commit cd7366498a

View File

@ -41,7 +41,7 @@ const nextConfig = {
}, },
generateBuildId: async () => { generateBuildId: async () => {
// This could be anything, using the latest git hash // This could be anything, using the latest git hash
return `${pkg.name} - ${pkg.version} `; return `${pkg.name}-${pkg.version}-${new Date().getTime()}`;
}, },
images: { images: {
unoptimized: true, unoptimized: true,
@ -157,6 +157,12 @@ module.exports = {
// Modify the file loader rule to ignore *.svg, since we have it handled now. // Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i; fileLoaderRule.exclude = /\.svg$/i;
if (config?.output?.filename)
config.output.filename = config.output.filename?.replace(
"[chunkhash]",
`[contenthash]`,
);
return config; return config;
}, },
...nextConfig, ...nextConfig,