Comments (3)
Thanks for the report! I opened ad PR to allow strings.
I thought the goal of babel-polyfills is to get rid of all this?
Yes and no. The goal of babel-polyfills
is to avoid injecting imports to unnecessary polyfills. However, if a modern polyfill includes an import to some legacy code, there is nothing that we can do about that.
Atm, the compiled file is actually bigger than what I had before.
Is this compared to core-js 3 with preset-env, or to core-js 2? In the first case it's unexpected, in the second case is because core-js@3
handles many more edge cases.
from babel-polyfills.
Just got the same error when passing string targets
to polyfill-regenerator
too. polyfill-regenerator
doesn't even seem to support targets
per #36 , but still gets the error, so that makes me think it's a bug in the shared helper all the polyfill plugins use, @babel/helper-define-polyfill-provider
.
It also uses @babel/helper-compilation-targets
which is used in @babel/preset-env
, so it's gotta be somewhere in between then. I think the bug would be in this file, but not totally sure.
from babel-polyfills.
Is this compared to core-js 3 with preset-env, or to core-js 2? In the first case it's unexpected, in the second case is because core-js@3 handles many more edge cases.
Compared to core-js 3
Yes and no. The goal of babel-polyfills is to avoid injecting imports to unnecessary polyfills. However, if a modern polyfill includes an import to some legacy code, there is nothing that we can do about that.
Is it true that since the polyfill has access to targets now, it should not ship code which is not required? If so, I guess polyfill write needs to catch up first, right?
from babel-polyfills.
Related Issues (20)
- [Bug]: `babel-plugin-polyfill-corejs3` injects imports from non-existent modules in `core-js-pure` when `version` is specified HOT 2
- preset-env doesn't import "array.push" polyfill HOT 1
- [Bug]: The documentation for babel-plugin-polyfill-corejs3 seems to have an error description? HOT 1
- `usage-pure` has incorrect optimization logic HOT 4
- No matching version found for @babel/helper-define-polyfill-provider@^0.4.1 HOT 1
- Switch semver from @nicolo-ribaudo/semver-v6 to original one HOT 1
- core-js-pure/features/instance/to-array.js does not exist HOT 1
- Excluding `es.json.stringify` does not work
- Please release HOT 1
- dom-exception polyfill import fails HOT 7
- no matcing version HOT 1
- Sorting `core-js` modules in the order from `core-js-compat`
- Why createMetaResolver ignores object for instance polyfills HOT 1
- Does babel-polyfills have any strategy to prevent creating cycles?
- Does babel-polyfills have any strategy to deal with repeated injection of different version of core-js library?
- Does the option `helpers: true` from `@babel/plugin-transform-runtime` do the same as `babel-plugin-polyfill-regenerator`? HOT 1
- Error: Can't resolve '@babel/runtime-corejs3/helpers/asyncToGenerator' HOT 1
- useBuiltIns: 'usage' will only transpile but not polyfill my nuxt v2 app
- When I use polyfill-es-shims plugin on my code it tries to import nodeJS `util.inspect` which requires rollup-plugin-polyfill-node... HOT 3
- helper-define-polyfill-provider: Cannot read properties of undefined (reading 'includes') HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-polyfills.