diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index e3b76416..f9b62556 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -7,6 +7,24 @@ on: branches: [main] jobs: + bundlesize: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - run: yarn install + - run: npx lerna run build + - name: Get Bundle Size + uses: lironer/bundlemon-action@v1 + inspect: runs-on: ubuntu-latest strategy: diff --git a/bundlemon.config.cjs b/bundlemon.config.cjs new file mode 100644 index 00000000..55a99334 --- /dev/null +++ b/bundlemon.config.cjs @@ -0,0 +1,23 @@ +/* eslint-disable no-undef */ +module.exports = { + reportOutput: ["github"], + baseDir: "./packages/documentation/dist", + defaultCompression: "gzip", + files: [ + { + path: "index.html", + maxSize: "2kb", + }, + { + path: "assets/index-.js", + maxSize: "50kb", + }, + { + path: "assets/index-.css", + maxSize: "3kb", + }, + { + path: "assets/**/*.{png,svg}", + }, + ], +}; diff --git a/packages/documentation/package.json b/packages/documentation/package.json index 727404bf..54a529fd 100644 --- a/packages/documentation/package.json +++ b/packages/documentation/package.json @@ -6,9 +6,10 @@ "type": "module", "private": true, "scripts": { + "bundlesize": "bundlemon", "clean": "rimraf dist", "dev": "vite --host", - "build": "yarn run clean && tsc && vite build", + "build": "yarn run clean && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix --color", "start": "static-server dist --port 5173", "test": "echo \"WARNING: no test specified\" && exit 0",