File tree Expand file tree Collapse file tree 8 files changed +1141
-74
lines changed
Expand file tree Collapse file tree 8 files changed +1141
-74
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ jobs:
109109 if : ${{ matrix.package != 'ui' }}
110110 run : yarn ${{ matrix.package }} build
111111
112+ - name : Check ${{ matrix.package }} bundle size
113+ if : ${{ matrix.package == 'react' }}
114+ run : yarn react size
115+
112116 - name : Cache ${{ matrix.package }}/dist
113117 uses : actions/cache@v2
114118 with :
Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ jobs:
132132 if : ${{ matrix.package != 'ui' }}
133133 run : yarn ${{ matrix.package }} build
134134
135+ - name : Check ${{ matrix.package }} bundle size
136+ if : ${{ matrix.package == 'react' }}
137+ run : yarn react size
138+
135139 - name : Cache ${{ matrix.package }}/dist
136140 uses : actions/cache@v2
137141 with :
Original file line number Diff line number Diff line change 2121 "scripts" : {
2222 "dev" : " react-app-rewired start" ,
2323 "build" : " react-app-rewired build" ,
24+ "postbuild" : " yarn run size-limit" ,
2425 "test" : " react-app-rewired test" ,
2526 "start" : " serve build -s -p 3000" ,
2627 "eject" : " react-app-rewired eject"
4445 ]
4546 },
4647 "devDependencies" : {
48+ "@size-limit/preset-app" : " ^7.0.8" ,
4749 "customize-cra" : " ^1.0.0" ,
4850 "react-app-rewired" : " ^2.2.1" ,
49- "serve" : " ^13.0.2"
50- }
51+ "serve" : " ^13.0.2" ,
52+ "size-limit" : " ^7.0.8"
53+ },
54+ "size-limit" : [
55+ {
56+ "path" : " build/static/js/main.*.js" ,
57+ "limit" : " 280 kB"
58+ }
59+ ]
5160}
Original file line number Diff line number Diff line change 1717 "dev" : " react-app-rewired start" ,
1818 "start" : " serve build -s -p 3000" ,
1919 "build" : " react-app-rewired build" ,
20+ "postbuild" : " yarn run size-limit" ,
2021 "test" : " react-app-rewired test" ,
2122 "eject" : " react-app-rewired eject"
2223 },
3940 ]
4041 },
4142 "devDependencies" : {
43+ "@size-limit/preset-app" : " ^7.0.8" ,
4244 "customize-cra" : " ^1.0.0" ,
4345 "react-app-rewired" : " ^2.2.1" ,
44- "serve" : " ^13.0.2"
45- }
46+ "serve" : " ^13.0.2" ,
47+ "size-limit" : " ^7.0.8"
48+ },
49+ "size-limit" : [
50+ {
51+ "path" : " build/static/js/main.*.js" ,
52+ "limit" : " 280 kB"
53+ }
54+ ]
4655}
Original file line number Diff line number Diff line change 44 "scripts" : {
55 "dev" : " next dev" ,
66 "build" : " next build" ,
7+ "postbuild" : " yarn run size-limit" ,
78 "start" : " next start" ,
89 "lint" : " next lint"
910 },
1516 "react-dom" : " latest"
1617 },
1718 "devDependencies" : {
19+ "@size-limit/preset-app" : " ^7.0.8" ,
1820 "eslint" : " 8.8.0" ,
19- "eslint-config-next" : " 12.0.10"
20- }
21+ "eslint-config-next" : " 12.0.10" ,
22+ "size-limit" : " ^7.0.8"
23+ },
24+ "size-limit" : [
25+ {
26+ "path" : " .next/static/**/*.js" ,
27+ "limit" : " 350 kB"
28+ }
29+ ]
2130}
Original file line number Diff line number Diff line change 55 "scripts" : {
66 "dev" : " vite" ,
77 "build" : " vite build" ,
8+ "postbuild" : " yarn run size-limit" ,
89 "preview" : " vite preview" ,
910 "start" : " vite preview --port 3000"
1011 },
1516 "react-dom" : " latest"
1617 },
1718 "devDependencies" : {
19+ "@size-limit/preset-app" : " ^7.0.8" ,
1820 "@vitejs/plugin-react" : " ^1.0.7" ,
21+ "size-limit" : " ^7.0.8" ,
1922 "vite" : " ^2.8.0"
20- }
23+ },
24+ "size-limit" : [
25+ {
26+ "path" : " dist/assets/index.*.js" ,
27+ "limit" : " 300 kB"
28+ }
29+ ]
2130}
Original file line number Diff line number Diff line change 5454 "test" : " yarn test:unit" ,
5555 "test:watch" : " yarn test:unit:watch" ,
5656 "test:unit" : " jest" ,
57- "test:unit:watch" : " jest --watch"
57+ "test:unit:watch" : " jest --watch" ,
58+ "size" : " yarn run size-limit"
5859 },
5960 "dependencies" : {
6061 "@aws-amplify/ui" : " 3.7.0" ,
8687 },
8788 "devDependencies" : {
8889 "@rollup/plugin-typescript" : " ^8.3.1" ,
90+ "@size-limit/preset-big-lib" : " ^7.0.8" ,
8991 "@svgr/core" : " ^5.5.0" ,
9092 "@testing-library/jest-dom" : " ^5.14.1" ,
9193 "@testing-library/react" : " ^12.0.0" ,
112114 "rollup" : " ^2.70.0" ,
113115 "rollup-plugin-styles" : " ^4.0.0" ,
114116 "rollup-plugin-terser" : " ^7.0.2" ,
117+ "size-limit" : " ^7.0.8" ,
115118 "ts-jest" : " ^27.0.3" ,
116119 "ts-morph" : " ^12.0.0" ,
117120 "ts-node" : " ^10.2.1"
118121 },
119122 "sideEffects" : [
120123 " dist/**/*.css"
124+ ],
125+ "size-limit" : [
126+ {
127+ "path" : " dist/esm/index.js" ,
128+ "import" : " { Authenticator }" ,
129+ "limit" : " 100 kB"
130+ }
121131 ]
122132}
You can’t perform that action at this time.
0 commit comments