workflow: report brotli size of baseline build
This commit is contained in:
parent
1928c9b537
commit
d0ea900922
@ -6,7 +6,7 @@
|
|||||||
"build": "node scripts/build.js",
|
"build": "node scripts/build.js",
|
||||||
"size": "run-s size-global size-baseline",
|
"size": "run-s size-global size-baseline",
|
||||||
"size-global": "node scripts/build.js vue runtime-dom -f global -p",
|
"size-global": "node scripts/build.js vue runtime-dom -f global -p",
|
||||||
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build",
|
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli",
|
||||||
"lint": "eslint --ext .ts packages/*/src/**.ts",
|
"lint": "eslint --ext .ts packages/*/src/**.ts",
|
||||||
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
|
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
|
||||||
"test": "run-s \"test-unit -- {@}\" \"test-e2e -- {@}\" --",
|
"test": "run-s \"test-unit -- {@}\" \"test-e2e -- {@}\" --",
|
||||||
|
6
packages/size-check/brotli.js
Normal file
6
packages/size-check/brotli.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
const { compress } = require('brotli')
|
||||||
|
|
||||||
|
const file = require('fs').readFileSync('dist/index.js')
|
||||||
|
const compressed = compress(file)
|
||||||
|
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
||||||
|
console.log(`brotli: ${compressedSize}`)
|
Loading…
Reference in New Issue
Block a user