Skip to content

Commit

Permalink
Add config flags for better memory usage in builds (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMaiolo authored Jul 9, 2024
1 parent 9969a06 commit db5a036
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,25 @@ const baseNextConfig = {
transpilePackages: ["@zetachain/ui-toolkit"],
experimental: {
externalDir: true,
/**
* Generating source maps consumes extra memory during the build process.
* https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage#disable-source-maps
*/
serverSourceMaps: false,
/**
* The Webpack build worker allows you to run Webpack compilations inside a separate Node.js worker
* which will decrease memory usage of your application during builds.
* https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage#webpack-build-worker
*/
webpackBuildWorker: true,
},
trailingSlash: true,
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
/**
* Generating source maps consumes extra memory during the build process.
* https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage#disable-source-maps
*/
productionBrowserSourceMaps: false,
headers: async () => nextHeadersConfig,
webpack(config) {
// eslint-disable-next-line no-param-reassign
Expand Down

0 comments on commit db5a036

Please sign in to comment.