Skip to content

Commit c3514c6

Browse files
committed
enhance: Remove unnecessary polyfills in build
1 parent 8ed8636 commit c3514c6

File tree

14 files changed

+39
-25
lines changed

14 files changed

+39
-25
lines changed

.changeset/plain-cars-watch.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@data-client/use-enhanced-reducer': patch
3+
'@data-client/normalizr': patch
4+
'@data-client/endpoint': patch
5+
'@data-client/graphql': patch
6+
'@data-client/react': patch
7+
'@data-client/core': patch
8+
'@data-client/rest': patch
9+
'@data-client/test': patch
10+
'@data-client/img': patch
11+
---
12+
13+
Remove unnecessary polyfills in build

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = function (api) {
88
process.env.NODE_ENV +
99
process.env.BROWSERSLIST_ENV +
1010
process.env.COMPILE_TARGET +
11+
process.env.POLYFILL_TARGETS +
1112
'0',
1213
);
1314
return {

examples/coin-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"anansi"
2525
],
2626
"devDependencies": {
27-
"@anansi/babel-preset": "^6.1.6",
27+
"@anansi/babel-preset": "6.2.1",
2828
"@anansi/browserslist-config": "^1.4.3",
2929
"@anansi/webpack-config": "^20.0.0",
3030
"@babel/core": "^7.22.15",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"extends @anansi/browserslist-config"
5050
],
5151
"devDependencies": {
52-
"@anansi/babel-preset": "6.2.0",
52+
"@anansi/babel-preset": "6.2.1",
5353
"@anansi/browserslist-config": "1.7.2",
5454
"@anansi/eslint-plugin": "1.0.28",
5555
"@anansi/jest-preset": "0.11.14",

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"./data_client_logo_and_text.svg"
6868
],
6969
"scripts": {
70-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' yarn g:babel --out-dir lib",
71-
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' yarn g:babel --out-dir legacy",
70+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
71+
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy",
7272
"build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup",
7373
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",
7474
"build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json",

packages/endpoint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
"README.md"
108108
],
109109
"scripts": {
110-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' yarn g:babel --out-dir lib --ignore 'src/schemas-3.7'",
111-
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' yarn g:babel --out-dir legacy --ignore 'src/schemas-3.7'",
110+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib --ignore 'src/schemas-3.7'",
111+
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy --ignore 'src/schemas-3.7'",
112112
"build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup && echo '{\"type\":\"commonjs\"}' > dist/package.json",
113113
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",
114114
"build:bundle": "yarn g:runs build:js:\\*",

packages/graphql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
"README.md"
9191
],
9292
"scripts": {
93-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' yarn g:babel --out-dir lib",
94-
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' yarn g:babel --out-dir legacy",
93+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
94+
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy",
9595
"build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup",
9696
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",
9797
"build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json",

packages/img/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"README.md"
6060
],
6161
"scripts": {
62-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV=2019 yarn g:babel --out-dir lib",
62+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2019' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
6363
"build:js:node": "BROWSERSLIST_ENV=node16 yarn g:rollup",
6464
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",
6565
"build:bundle": "yarn g:runs build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json",

packages/normalizr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
"build:js:development": "BROWSERSLIST_ENV=legacy NODE_ENV=development yarn g:rollup",
9696
"build:js:production": "BROWSERSLIST_ENV=legacy NODE_ENV=production yarn g:rollup",
9797
"build:js:node": "BROWSERSLIST_ENV=node12 NODE_ENV=development yarn g:rollup && echo '{\"type\":\"commonjs\"}' > dist/package.json",
98-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' yarn g:babel --out-dir lib",
99-
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' yarn g:babel --out-dir legacy",
98+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
99+
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy",
100100
"build:bundle": "yarn g:runs build:js:\\*",
101101
"build:clean": "yarn g:clean ts3.4 ts4.0 ts4.1",
102102
"build:legacy-types": "yarn g:legacy-types 4.1 4.0 3.4",

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@
151151
"./typescript.svg"
152152
],
153153
"scripts": {
154-
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' yarn g:babel --out-dir lib",
155-
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' yarn g:babel --out-dir legacy",
154+
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
155+
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' POLYFILL_TARGETS='chrome>80,safari>13,firefox>72' yarn g:babel --out-dir legacy",
156156
"build:native:lib": "COMPILE_TARGET=native NODE_ENV=production BROWSERSLIST_ENV='hermes12' yarn g:babel --out-dir native",
157157
"build:js:node": "BROWSERSLIST_ENV=node12 yarn g:rollup",
158158
"build:js:browser": "BROWSERSLIST_ENV=legacy yarn g:rollup",

0 commit comments

Comments
 (0)