Skip to content

Commit c95a31d

Browse files
committed
build: validate bundle size
1 parent 12d7b1b commit c95a31d

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ install:
2222
- npm install
2323
- npm ls react
2424
script:
25-
- kcd-scripts validate lint,test:cover,build-and-test
25+
- npm run validate
2626
after_success: kcd-scripts travis-after-success
2727
branches:
2828
except:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ View an example in [codesandbox.io](https://codesandbox.io/s/48k5p1r764?module=%
5151

5252
## Highlights
5353

54-
- :package: Super tiny (~600 bytes)
54+
- :package: Super tiny (~650 bytes)
5555
- :ok_hand: Dependency free (except for [Object.assign](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) polyfill)
5656
- :electric_plug: Just Works <sup>TM</sup>
5757
- :crystal_ball: Tree shaking friendly (ESM, no side effects)

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
"add-contributor": "kcd-scripts contributors add",
2121
"build": "kcd-scripts build --bundle --no-clean --size-snapshot",
2222
"lint": "kcd-scripts lint",
23+
"bundlesize": "bundlesize",
2324
"test": "kcd-scripts test",
2425
"test:cover": "kcd-scripts test --coverage",
2526
"test:update": "npm test -- --updateSnapshot --coverage",
26-
"test:build": "jest --projects other/misc-tests",
27+
"test:build": "jest --projects other/misc-tests && npm run bundlesize",
2728
"flowgen": "flowgen typings/index.d.ts -o flow-typed/npm/react-render-callback_v1.x.x.js.flow",
2829
"build-and-test": "npm run build -s && npm run test:build -s",
2930
"validate": "kcd-scripts validate lint,test:cover,build-and-test",
@@ -45,6 +46,7 @@
4546
"@types/react": "^0.14 || ^15 || ^16",
4647
"ajv": "^6.5.3",
4748
"babel-plugin-dynamic-import-node": "^2.1.0",
49+
"bundlesize": "^0.17.0",
4850
"flowgen": "^1.2.2",
4951
"kcd-scripts": "^0.44.0",
5052
"react": "^0.14 || ^15 || ^16",
@@ -65,6 +67,12 @@
6567
"flow-typed",
6668
"typings"
6769
],
70+
"bundlesize": [
71+
{
72+
"path": "dist/react-render-callback.umd.min.js",
73+
"maxSize": "650 B"
74+
}
75+
],
6876
"keywords": [
6977
"react",
7078
"render-prop",

0 commit comments

Comments
 (0)