Enable es6 polyfills
See original GitHub issueI have such webpack config for babel-loader:
// ...
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel?stage=0&optional=runtime&externalHelpers']
}
}
However running such code let copy = someArray.copyWithin(0);
returns Uncaught TypeError: someArray.copyWithin is not a function
, any ideas (it works in repl)?
Some other methods like Object.assign
work fine…
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:17 (4 by maintainers)
Top Results From Across the Web
es6-polyfill
A javascript polyfill library for es6 API such as findIndex, Array.from, etc.. Latest version: 1.1.0, last published: 4 years ago.
Read more >Polyfills and transpilers
Just don't forget to use a transpiler (if using modern syntax or operators) and polyfills (to add functions that may be missing). They'll...
Read more >babel/polyfill
Available from the dist/polyfill.js file within a @babel/polyfill npm release. This needs to be included before all your compiled Babel code. You can...
Read more >Polyfills to support IE 11 and non ES6 browsers
If you are writing your JavaScript using ES6 or ES5, ... Below is a list of polyfills that we use that Babel does...
Read more >Angular polyfills for es6 - typescript
Perhaps you don't understand what polyfills are used for. They allow you to use modern functionality in older browsers by adding support for ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just a heads up to those finding this from Google that haven’t looked at the site lately (like me), the polyfill is no longer available in
babel-core/polyfill
unless I just really screwed up big time somewhere somehow, but it’s now a separate module altogether.Then you can set it as an entry in your webpack config:
or import it:
Docs: https://babeljs.io/docs/usage/polyfill/
Resolving this as a resolution to the initial question exists in the issue