Skip to content

Commit b75f805

Browse files
author
martinadamsdev
committed
feat: add the @next/bundle-analyzer.
1 parent be56380 commit b75f805

File tree

3 files changed

+125
-2
lines changed

3 files changed

+125
-2
lines changed

next.config.mjs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
import withBundleAnalyzer from '@next/bundle-analyzer'
2+
3+
withBundleAnalyzer({
4+
enabled: process.env.ANALYZE === 'true',
5+
})
6+
17
/** @type {import('next').NextConfig} */
28
const nextConfig = {};
39

4-
export default nextConfig;
10+
export default nextConfig

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"analyze": "ANALYZE=true pnpm build"
1011
},
1112
"dependencies": {
1213
"@vercel/analytics": "^1.2.2",
@@ -16,6 +17,7 @@
1617
"react-dom": "^18"
1718
},
1819
"devDependencies": {
20+
"@next/bundle-analyzer": "^14.1.1",
1921
"@types/node": "^20",
2022
"@types/react": "^18",
2123
"@types/react-dom": "^18",

pnpm-lock.yaml

+115
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)