Skip to content

Commit

Permalink
Remove webpack chunk plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bookernath committed Nov 19, 2024
1 parent 179950a commit e44c8d6
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions core/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ export default async (): Promise<NextConfig> => {
ignoreDuringBuilds: !!process.env.CI,
dirs: ['app', 'client', 'components', 'lib', 'middlewares'],
},
webpack: (config, { isServer }) => {
// Limit the number of chunks to reduce CDN requests, which contribute to Edge Request costs
// Making this number higher may improve performance, but making it lower will reduce total requests and costs
// Simply set the WEBPACK_MAX_CHUNKS environment variable to the desired number of chunks
if (!isServer) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
config.plugins.push(
new optimize.LimitChunkCountPlugin({
maxChunks: process.env.WEBPACK_MAX_CHUNKS
? parseInt(process.env.WEBPACK_MAX_CHUNKS, 10)
: 50,
}),
);
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return config;
},
// default URL generation in BigCommerce uses trailing slash
trailingSlash: process.env.TRAILING_SLASH !== 'false',
// eslint-disable-next-line @typescript-eslint/require-await
Expand Down

0 comments on commit e44c8d6

Please sign in to comment.