chore: configure rollup visualizer reports

This commit is contained in:
snomiao
2025-10-15 05:45:30 +00:00
parent fb3ab88f04
commit 902a13e61f
3 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
# Bundle Size Reports
This directory is the output target for the Rollup visualizer report generated during `pnpm build`. The report file is emitted as `index.html`, and it can be published from the `.pages` directory if you want to surface the bundle analysis (for example on GitHub Pages).
Files in this directory are generated; regenerate them by re-running the production build.

View File

@@ -88,6 +88,7 @@
"nx": "catalog:",
"postcss-html": "catalog:",
"prettier": "catalog:",
"rollup-plugin-visualizer": "^5.12.0",
"storybook": "catalog:",
"stylelint": "catalog:",
"tailwindcss": "catalog:",

View File

@@ -9,6 +9,7 @@ import { defineConfig } from 'vite'
import type { UserConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'
import vueDevTools from 'vite-plugin-vue-devtools'
import { visualizer } from 'rollup-plugin-visualizer'
import { comfyAPIPlugin, generateImportMapPlugin } from './build/plugins'
@@ -163,7 +164,19 @@ export default defineConfig({
deep: true,
extensions: ['vue'],
directoryAsNamespace: true
})
}),
...(IS_DEV
? []
: [
visualizer({
filename: '.pages/size-reports/index.html',
template: 'treemap',
gzipSize: true,
brotliSize: true,
emitFile: false
})
])
],
build: {