Commit 40b377c4 by Moorthy G

chore: replace webpack bundle analyzer with next bundle analyzer

parent 67f286fc
module.exports = {
import withBundleAnalyzer from '@next/bundle-analyzer';
const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true'
});
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
......@@ -8,19 +15,6 @@ module.exports = {
],
imageSizes: [64, 128, 256, 576, 768, 992, 1200, 1600, 1920, 2048, 3840]
},
webpack: (config, { isServer }) => {
if (process.env.ANALYZE && !isServer) {
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true
})
);
}
return config;
},
async rewrites() {
return [
{
......@@ -32,3 +26,5 @@ module.exports = {
poweredByHeader: false,
compress: false
};
export default bundleAnalyzer(nextConfig);
......@@ -32,6 +32,7 @@
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@next/bundle-analyzer": "^15.1.8",
"@storybook/addon-essentials": "^8.6.14",
"@storybook/addon-interactions": "8.6.14",
"@storybook/addon-links": "^8.6.14",
......@@ -52,8 +53,7 @@
"prettier": "^3.5.3",
"pretty-quick": "^4.1.1",
"storybook": "^8.6.14",
"storybook-dark-mode": "^4.0.2",
"webpack-bundle-analyzer": "^4.10.2"
"storybook-dark-mode": "^4.0.2"
},
"packageManager": "pnpm@10.6.5+sha256.47c8bca42b4b48534b5b1b28d573c506773937b02f68e52992fbd8269131c5c8"
}
......@@ -66,6 +66,9 @@ importers:
'@commitlint/config-conventional':
specifier: ^19.8.1
version: 19.8.1
'@next/bundle-analyzer':
specifier: ^15.1.8
version: 15.1.8
'@storybook/addon-essentials':
specifier: ^8.6.14
version: 8.6.14(@types/react@19.1.5)(storybook@8.6.14(prettier@3.5.3))
......@@ -129,9 +132,6 @@ importers:
storybook-dark-mode:
specifier: ^4.0.2
version: 4.0.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(storybook@8.6.14(prettier@3.5.3))
webpack-bundle-analyzer:
specifier: ^4.10.2
version: 4.10.2
packages:
......@@ -1813,6 +1813,9 @@ packages:
'@napi-rs/wasm-runtime@0.2.10':
resolution: {integrity: sha512-bCsCyeZEwVErsGmyPNSzwfwFn4OdxBj0mmv6hOFucB/k81Ojdu68RbZdxYsRQUPc9l6SU5F/cG+bXgWs3oUgsQ==}
'@next/bundle-analyzer@15.1.8':
resolution: {integrity: sha512-HNTcO3QhZ3RY3ZpHyqpl30WtAKZGF5WJgi/zVBMcgFuEk0k4cA/kiUCwApxAgkHcfvdBi3JytzQUXCAnSGljjQ==}
'@next/env@15.3.2':
resolution: {integrity: sha512-xURk++7P7qR9JG1jJtLzPzf0qEvqCN0A/T3DXf8IPMKo9/6FfjxtEffRJIIew/bIL4T3C2jLLqBor8B/zVlx6g==}
......@@ -4595,6 +4598,10 @@ packages:
resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
engines: {node: '>=8'}
is-plain-object@5.0.0:
resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
engines: {node: '>=0.10.0'}
is-regex@1.2.1:
resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==}
engines: {node: '>= 0.4'}
......@@ -6087,8 +6094,8 @@ packages:
wcwidth@1.0.1:
resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
webpack-bundle-analyzer@4.10.2:
resolution: {integrity: sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==}
webpack-bundle-analyzer@4.10.1:
resolution: {integrity: sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ==}
engines: {node: '>= 10.13.0'}
hasBin: true
......@@ -8545,6 +8552,13 @@ snapshots:
'@tybys/wasm-util': 0.9.0
optional: true
'@next/bundle-analyzer@15.1.8':
dependencies:
webpack-bundle-analyzer: 4.10.1
transitivePeerDependencies:
- bufferutil
- utf-8-validate
'@next/env@15.3.2': {}
'@next/eslint-plugin-next@15.3.2':
......@@ -12181,6 +12195,8 @@ snapshots:
is-obj@2.0.0: {}
is-plain-object@5.0.0: {}
is-regex@1.2.1:
dependencies:
call-bound: 1.0.4
......@@ -13754,7 +13770,7 @@ snapshots:
dependencies:
defaults: 1.0.4
webpack-bundle-analyzer@4.10.2:
webpack-bundle-analyzer@4.10.1:
dependencies:
'@discoveryjs/json-ext': 0.5.7
acorn: 8.14.1
......@@ -13764,6 +13780,7 @@ snapshots:
escape-string-regexp: 4.0.0
gzip-size: 6.0.0
html-escaper: 2.0.2
is-plain-object: 5.0.0
opener: 1.5.2
picocolors: 1.1.1
sirv: 2.0.4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment