Skip to content

Commit 24be8e3

Browse files
author
Kerem Sirin
committed
feat: add bundle analyzer
1 parent d720412 commit 24be8e3

File tree

3 files changed

+134
-3
lines changed

3 files changed

+134
-3
lines changed

next.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import type { NextConfig } from 'next';
22
import createNextIntlPlugin from 'next-intl/plugin';
3+
import bundleAnalyzer from '@next/bundle-analyzer';
34

45
const withNextIntl = createNextIntlPlugin({
56
requestConfig: './src/lib/i18n/i18n.ts',
67
});
78

8-
const nextConfig: NextConfig = {
9+
const withBundleAnalyzer = bundleAnalyzer({
10+
enabled: process.env.ANALYZE === 'true',
11+
})
12+
13+
let nextConfig: NextConfig = {
914
poweredByHeader: false,
1015

1116
webpack(config) {
@@ -22,4 +27,7 @@ const nextConfig: NextConfig = {
2227
},
2328
};
2429

25-
export default withNextIntl(nextConfig);
30+
nextConfig = withNextIntl(nextConfig);
31+
nextConfig = withBundleAnalyzer(nextConfig);
32+
33+
export default nextConfig;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
"version": "changeset version && pnpm install --no-frozen-lockfile",
2727
"ci:review": "pnpm run lint",
2828
"prepare": "husky",
29-
"precommit": "lint-staged"
29+
"precommit": "lint-staged",
30+
"analyze": "ANALYZE=true pnpm build"
3031
},
3132
"dependencies": {
33+
"@next/bundle-analyzer": "15.4.6",
3234
"clsx": "2.1.1",
3335
"next": "15.4.5",
3436
"next-intl": "4.3.4",

pnpm-lock.yaml

Lines changed: 121 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)