Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove webpack chunk plugin #1661

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/forty-actors-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Remove webpack chunk plugin
19 changes: 0 additions & 19 deletions core/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import bundleAnalyzer from '@next/bundle-analyzer';
import type { NextConfig } from 'next';
import createNextIntlPlugin from 'next-intl/plugin';
import { optimize } from 'webpack';

import { writeBuildConfig } from './build-config/writer';
import { client } from './client';
Expand Down Expand Up @@ -36,24 +35,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
1 change: 0 additions & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"tailwind-merge": "^2.5.4",
"tailwindcss-radix": "^3.0.5",
"uuid": "^11.0.3",
"webpack": "^5.96.1",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
Loading
Loading