diff --git a/next.config.js b/next.config.js index 2ae815b..ee180ca 100644 --- a/next.config.js +++ b/next.config.js @@ -9,6 +9,29 @@ module.exports = { name: 'static/media/[name].[hash:8].[ext]', }, }); + + config.optimization.splitChunks = { + chunks: 'async', + minSize: 20000, + minRemainingSize: 0, + minChunks: 1, + maxAsyncRequests: 30, + maxInitialRequests: 30, + enforceSizeThreshold: 50000, + cacheGroups: { + defaultVendors: { + test: /[\\/]node_modules[\\/]/, + priority: -10, + reuseExistingChunk: true, + }, + default: { + minChunks: 2, + priority: -20, + reuseExistingChunk: true, + }, + }, + }; + return config; }, }