-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
i: discussionimportedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: preset-env
Description
Issue originally reported by @hzoo in babel/babel-preset-env#248
Just going to make another issue to talk about the ideal scenario for both polyfills and babel helpers and how we can get there via babel-preset-env.
How can we write ES20xx and ship the smallest amount of code (for a given target environment)?
- syntax: if your target environment supports that syntax, don't compile it (the original point of this project)
- polyfill: if your target environment supports that built-in, don't polyfill it (done in Feature request: transform a require('babel-polyfill') call to specific requires base on the env config babel-preset-env#20 v1.0.0)
- polyfill: if your code doesn't actually use the polyfill, don't add it (do a pass over all code to find the use of a built-in) Breaking: make current "useBuiltIns" auto import only used + necessary polyfills per file babel-preset-env#241
- bundler: do polyfills need to be it's own chunk (webpack)?
- babel helpers: reference the same helpers instead of recreating per file (either via https://github.com/babel/babel/tree/7.0/packages/babel-plugin-transform-runtime#options) or (http://babeljs.io/docs/plugins/external-helpers)
- Move transform-runtime functionality into this preset babel-preset-env#246 Move transform-runtime into this preset if a library (
type: "library")? - Move External-helpers functionality into this preset babel-preset-env#247 Move external-helpers into this preset if an application (
type: "app")?
- Move transform-runtime functionality into this preset babel-preset-env#246 Move transform-runtime into this preset if a library (
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
i: discussionimportedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: preset-env