Skip to content

Commit 15fc1af

Browse files
committed
✨ Add feature to only include polyfills required by your code
If `usage` option is set, the code is analyzed and only polyfills for your code are included. Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 10f0c2c commit 15fc1af

File tree

6 files changed

+572
-83
lines changed

6 files changed

+572
-83
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ You can omit setting `targets` in this case browserslist is used (`package.json`
7070
exclude?: string | readonly string[] | readonly RegExp[],
7171
/** Overide browserslist targets */
7272
targets?: string | readonly string[] | Record<string, string | readonly string[]>
73-
/** Add comment which modules are used within bundle */
74-
summary?: {
75-
size: boolean
76-
modules: boolean
77-
}
73+
/** Only include polyfills for APIs used by your code (dependencies not included) */
74+
usage?: boolean
7875
}
7976
```
8077

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@
4444
"rollup": "^3.0"
4545
},
4646
"dependencies": {
47+
"acorn": "^8.8.2",
4748
"browserslist": "^4.21.5",
48-
"core-js-builder": "^3.29.1",
49+
"core-js-compat": "^3.30.0",
50+
"estree-toolkit": "^1.4.0",
4951
"magic-string": "^0.30.0"
5052
},
5153
"devDependencies": {
52-
"@rollup/plugin-typescript": "^11.0.0",
54+
"@rollup/plugin-typescript": "^11.1.0",
5355
"@types/jest": "^29.5.0",
5456
"jest": "^29.5.0",
5557
"prettier": "^2.8.6",

0 commit comments

Comments
 (0)