File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 55 branches :
66 - main
77
8+ env :
9+ BUNDLE_SIZE : true
10+
811jobs :
912 # Build current and upload stats.json
1013 # You may replace this with your own build method. All that
Original file line number Diff line number Diff line change 1+ import process from 'node:process'
12import { defineBuildConfig } from 'unbuild'
23import type { InputPluginOption } from 'rollup'
34import { purgePolyfills } from 'unplugin-purge-polyfills'
45import { visualizer } from 'rollup-plugin-visualizer'
56
7+ const isAnalysingSize = process . env . BUNDLE_SIZE === 'true'
8+
69export default defineBuildConfig ( {
7- declaration : true ,
10+ declaration : ! isAnalysingSize ,
811 hooks : {
912 'rollup:options' ( _ , options ) {
1013 const plugins = ( options . plugins ||= [ ] ) as InputPluginOption [ ]
1114 plugins . push ( purgePolyfills . rollup ( {
1215 logLevel : 'verbose' ,
1316 } ) )
14- plugins . unshift ( visualizer ( { template : 'raw-data' } ) )
17+ if ( isAnalysingSize ) {
18+ plugins . unshift ( visualizer ( { template : 'raw-data' } ) )
19+ }
1520 } ,
1621 } ,
1722 rollup : {
You can’t perform that action at this time.
0 commit comments