Skip to content

Commit

Permalink
@next/bundle-analyzerの導入 (#374)
Browse files Browse the repository at this point in the history
## Issue

- Github Issue: #231 

## 変更内容
- `npm run analyze:win` または `npm run analyze`でバンドルJSの分析が出来るように

@coderabbitai: ignore
  • Loading branch information
takecchi authored Mar 20, 2024
1 parent c8c2fc0 commit 5343741
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 10 deletions.
5 changes: 4 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
});
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down Expand Up @@ -50,4 +53,4 @@ const nextConfig = {
},
};

module.exports = withPWA(nextConfig);
module.exports = withBundleAnalyzer(withPWA(nextConfig));
171 changes: 162 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"scripts": {
"dev": "next dev",
"dev:proxy": "node proxy.js",
"analyze": "ANALYZE=true next build",
"analyze:win": "set ANALYZE=true&& next build",
"build": "next build",
"start": "next start",
"lint": "next lint -f stylish",
Expand Down Expand Up @@ -43,6 +45,7 @@
"devDependencies": {
"@fontsource/material-icons": "5.0.16",
"@fontsource/roboto": "5.0.12",
"@next/bundle-analyzer": "14.1.4",
"@storybook/addon-essentials": "8.0.2",
"@storybook/addon-interactions": "8.0.2",
"@storybook/addon-links": "8.0.2",
Expand Down

0 comments on commit 5343741

Please sign in to comment.