ci: introduce bundle size for package @excalidraw/excalidraw (#6785)
* ci: update bundle size limit * change the size script to track bundle size on the package excalidraw * fix build command * fix * remove * fix * update script * fix
This commit is contained in:
parent
a80ac4c748
commit
9fc15d81a0
6
.github/workflows/size-limit.yml
vendored
6
.github/workflows/size-limit.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: "size"
|
name: "Bundle Size check @excalidraw/excalidraw"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
@ -15,12 +15,10 @@ jobs:
|
|||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
- name: Install and build
|
|
||||||
run: yarn --frozen-lockfile
|
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- uses: andresz1/size-limit-action@v1
|
- uses: andresz1/size-limit-action@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
build_script: build:app
|
build_script: size
|
||||||
skip_step: install
|
skip_step: install
|
||||||
|
@ -146,13 +146,13 @@
|
|||||||
"autorelease": "node scripts/autorelease.js",
|
"autorelease": "node scripts/autorelease.js",
|
||||||
"prerelease": "node scripts/prerelease.js",
|
"prerelease": "node scripts/prerelease.js",
|
||||||
"release": "node scripts/release.js",
|
"release": "node scripts/release.js",
|
||||||
"size": "yarn build:app && size-limit"
|
"size": "node scripts/buildPackageExcalidraw.js && size-limit"
|
||||||
},
|
},
|
||||||
"size-limit": [
|
"size-limit": [
|
||||||
{
|
{
|
||||||
"limit": "500kb",
|
|
||||||
"path": [
|
"path": [
|
||||||
"build/static/js/*.js"
|
"src/packages/excalidraw/dist/excalidraw.development.js",
|
||||||
|
"src/packages/excalidraw/dist/excalidraw.production.min.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
16
scripts/buildPackageExcalidraw.js
Normal file
16
scripts/buildPackageExcalidraw.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
const { execSync } = require("child_process");
|
||||||
|
|
||||||
|
const excalidrawDir = `${__dirname}/../src/packages/excalidraw`;
|
||||||
|
|
||||||
|
const build = () => {
|
||||||
|
try {
|
||||||
|
execSync(`yarn --frozen-lockfile`);
|
||||||
|
execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir });
|
||||||
|
execSync(`yarn run build:umd`, { cwd: excalidrawDir });
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
build();
|
Loading…
x
Reference in New Issue
Block a user