-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathsize.js
More file actions
24 lines (22 loc) · 895 Bytes
/
size.js
File metadata and controls
24 lines (22 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require('./build.js');
const rolldown = require('rolldown');
rolldown.build({
input: 'esm/index.mjs', output: { minify: true }, write: false, treeshake: true
}).then(built => {
console.log(`esm/index.mjs: ${(built.output[0].code.length / 1024).toFixed(2)} KB`);
});
rolldown.build({
input: 'esm/system.mjs', output: { minify: true }, write: false, treeshake: true
}).then(built => {
console.log(`esm/system.mjs: ${(built.output[0].code.length / 1024).toFixed(2)} KB`);
});
rolldown.build({
input: 'cjs/index.cjs', output: { minify: true }, write: false, treeshake: true
}).then(built => {
console.log(`cjs/index.cjs: ${(built.output[0].code.length / 1024).toFixed(2)} KB`);
});
rolldown.build({
input: 'cjs/system.cjs', output: { minify: true }, write: false, treeshake: true
}).then(built => {
console.log(`cjs/system.cjs: ${(built.output[0].code.length / 1024).toFixed(2)} KB`);
});