Skip to content

Commit 87f7e45

Browse files
authored
chore: Add size-limit to the build process (#24)
1 parent 019c5cd commit 87f7e45

File tree

2 files changed

+194
-1
lines changed

2 files changed

+194
-1
lines changed

package-lock.json

Lines changed: 180 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"scripts": {
1010
"prebuild": "rm -rf lib dist .cache",
1111
"build": "npm-run-all build:pkg --parallel build:src:* --parallel build:pages:* build:themeable",
12+
"postbuild": "size-limit",
1213
"lint": "eslint --ignore-path .gitignore --ext ts,tsx,js . && stylelint --ignore-path .gitignore '{src,pages}/**/*.{css,scss}'",
1314
"prepare": "husky install",
1415
"test:unit": "vitest run --config vite.unit.config.mjs",
@@ -78,6 +79,7 @@
7879
"@cloudscape-design/global-styles": "^1.0.1",
7980
"@cloudscape-design/test-utils-converter": "^1.0.0",
8081
"@cloudscape-design/theming-build": "^1",
82+
"@size-limit/preset-small-lib": "^11.0.2",
8183
"@testing-library/jest-dom": "^5.16.5",
8284
"@testing-library/react": "^13.4.0",
8385
"@types/jest-image-snapshot": "^6.1.0",
@@ -112,6 +114,7 @@
112114
"react": "^18.2.0",
113115
"react-dom": "^18.2.0",
114116
"react-router-dom": "^6.6.1",
117+
"size-limit": "^11.0.2",
115118
"stylelint": "^15.11.0",
116119
"stylelint-config-recommended-scss": "^12.0.0",
117120
"stylelint-order": "^6.0.3",
@@ -136,5 +139,15 @@
136139
"package-lock.json": [
137140
"./scripts/prepare-package-lock.js"
138141
]
139-
}
142+
},
143+
"size-limit": [
144+
{
145+
"path": "lib/components/index.js",
146+
"limit": "0.5kb"
147+
},
148+
{
149+
"path": "lib/components/code-view/highlight/javascript.js",
150+
"limit": "1kb"
151+
}
152+
]
140153
}

0 commit comments

Comments
 (0)