Skip to content

Commit

Permalink
Fix production build webpack error
Browse files Browse the repository at this point in the history
The issues seems to have been caused by the size of the engine
webworker - see vercel/next.js#25484
  • Loading branch information
oetherington committed Dec 10, 2021
1 parent f4def87 commit 8d30157
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
}

1 comment on commit 8d30157

@vercel
Copy link

@vercel vercel bot commented on 8d30157 Dec 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.