Skip to content

Commit

Permalink
Restrict size with size-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Sep 4, 2020
1 parent f47c0bc commit 0da5e10
Show file tree
Hide file tree
Showing 3 changed files with 2,711 additions and 63 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'size'
on:
pull_request:
branches:
- master
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"prebuild": "rimraf dist && rimraf deno_dist",
"build": "denoify && rollup -c rollup.config.ts && typedoc --tsconfig tsconfig.json --target es6 src && deno fmt deno_dist/*.ts",
"start": "rollup -c rollup.config.ts -w",
"test": "jest --coverage && npm run test:deno",
"size": "size-limit",
"test": "jest --coverage && npm run test:deno && npm run size",
"test:deno": "deno test test/deno/*.spec.ts --unstable --allow-read",
"test:watch": "jest --coverage --watch",
"test:prod": "npm run lint && npm run test -- --no-cache",
Expand All @@ -49,6 +50,12 @@
"format": "prettier --write '{src,test}/**/!(*.deno).ts' && deno fmt deno_dist/*.ts",
"release": "np"
},
"size-limit": [
{
"path": "dist/browser/eta.min.js",
"limit": "3 KB"
}
],
"lint-staged": {
"{src,test}/**/!(*.deno).ts": [
"eslint"
Expand Down Expand Up @@ -109,6 +116,7 @@
"devDependencies": {
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@size-limit/preset-small-lib": "^4.5.7",
"@types/jest": "^26.0.12",
"@types/node": "^14.6.2",
"@typescript-eslint/eslint-plugin": "^4.0.1",
Expand Down Expand Up @@ -140,6 +148,7 @@
"rollup-plugin-terser": "^7.0.1",
"rollup-plugin-typescript2": "^0.27.2",
"shelljs": "^0.8.4",
"size-limit": "^4.5.7",
"travis-deploy-once": "^5.0.11",
"ts-jest": "^26.3.0",
"ts-node": "^9.0.0",
Expand Down
Loading

0 comments on commit 0da5e10

Please sign in to comment.