Skip to content

Commit d589c36

Browse files
committed
chore: filesize checker
1 parent 5c00c4e commit d589c36

File tree

4 files changed

+1025
-2
lines changed

4 files changed

+1025
-2
lines changed

build/bundle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { srcDir, pkgDistDir } from './path';
44
import vue from '@vitejs/plugin-vue';
55
import esbuild from 'rollup-plugin-esbuild';
66
import css from 'rollup-plugin-css-only';
7+
import filesize from 'rollup-plugin-filesize';
78
import { writeBundles, formatBundleFilename } from './utils/rollup';
89
import { Plugin } from 'rollup';
910

@@ -23,6 +24,7 @@ const build = async (minify: boolean) => {
2324
'.vue': 'ts',
2425
},
2526
}),
27+
filesize() as Plugin,
2628
],
2729
external: ['vue'],
2830
});

build/modules.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { rollup } from 'rollup';
33
import vue from '@vitejs/plugin-vue';
44
import esbuild from 'rollup-plugin-esbuild';
55
import css from 'rollup-plugin-css-only';
6+
import filesize from 'rollup-plugin-filesize';
67
import { buildConfig } from './config';
78
import { srcDir } from './path';
89
import type { Plugin } from 'rollup';
@@ -32,6 +33,7 @@ export const buildModules = async () => {
3233
'.vue': 'ts',
3334
},
3435
}),
36+
filesize() as Plugin,
3537
],
3638
external: ['vue'],
3739
});

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"lib"
2020
],
2121
"main": "lib/index.js",
22-
"module": "es/index.js",
23-
"style": "dist/index.css",
22+
"module": "es/index.js",
23+
"style": "dist/index.css",
2424
"exports": {
2525
".": {
2626
"import": "./es/index.js",
@@ -65,6 +65,7 @@
6565
"rollup": "^2.74.1",
6666
"rollup-plugin-css-only": "^3.1.0",
6767
"rollup-plugin-esbuild": "^4.9.1",
68+
"rollup-plugin-filesize": "^9.1.2",
6869
"sucrase": "^3.21.0",
6970
"ts-morph": "^14.0.0",
7071
"typescript": "^4.5.4",

0 commit comments

Comments
 (0)