Skip to content

Commit a5382c9

Browse files
committed
ci: skip dts when checking bundle size
1 parent bbc8290 commit a5382c9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/size.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77

8+
env:
9+
BUNDLE_SIZE: true
10+
811
jobs:
912
# Build current and upload stats.json
1013
# You may replace this with your own build method. All that

build.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
import process from 'node:process'
12
import { defineBuildConfig } from 'unbuild'
23
import type { InputPluginOption } from 'rollup'
34
import { purgePolyfills } from 'unplugin-purge-polyfills'
45
import { visualizer } from 'rollup-plugin-visualizer'
56

7+
const isAnalysingSize = process.env.BUNDLE_SIZE === 'true'
8+
69
export 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: {

0 commit comments

Comments
 (0)