Questions tagged [babel-polyfill]

Babel Polyfill will emulate a full ES6 environment. This polyfill is automatically loaded when using babel-node.

Installation:

$ npm install babel-polyfill

To find more information :

265 questions
9
votes
1 answer

Can Webpack tree-shaking remove unused babel-polyfills?

I try to make webpack tree-shaking remove unused babel-polyfill. index.js file contains: import 'babel-polyfill' const add4 = n => n + 4 const add5 = n => n + 5 add4(6) console.log('boom', add4(4)) In this file no code require any es2015+…
François Romain
  • 13,617
  • 17
  • 89
  • 123
8
votes
2 answers

How to add flatMap using babel 7?

After reading the article Removing Babel's Stage Presets by babel, I still not fully understand how to add a proposal from, for example, stage-3 (flatMap) to .babelrc. As far as I understand, because flatMap can be written in ES5, then I need a…
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
8
votes
1 answer

what features does the babel polyfill support?

Is there any type of list of what features the babel-polyfill supports? We just started using babel and i'm wondering if some of the dependencies we currently rely on can be eliminated like es6-promises & whatwg-fetch. If babel-polyfill supported…
coding4fun
  • 8,038
  • 13
  • 58
  • 85
7
votes
1 answer

fetch and Headers are undefined in IE11.0.9600 with babel-polyfill when process.env.NODE_ENV=='production'

When process.env.NODE_ENV=='development' - it is OK! But our production build failed in IE 11 (11.0.9600). All work fine in chrome 55. devDependencies: ... babel-core: "6.22.0", babel-eslint: "^7.0.0", babel-loader: "^6.2.5", babel-preset-env:…
7
votes
0 answers

Dynamically load babel polyfill only when needed?

I was watching an Advanced Webpack video. Right at about the 10 minute mark he talks about detecting whether you need the Babel-Polyfill at runtime and then loading it if you need it. I found this very interesting. I conversed with him but twitter…
coding4fun
  • 8,038
  • 13
  • 58
  • 85
6
votes
1 answer

Can Babel include regeneratorRuntime Dependency within the Generated Code?

Using babel to target Node v4, it seems the generated code depends on a regeneratorRuntime module which is not included in the output. From what I understand it seems that one must require the 'regenerator-runtime/runtime' module at runtime before…
lostsource
  • 21,070
  • 8
  • 66
  • 88
6
votes
0 answers

@babel/runtime: SyntaxError: Unexpected token export @babel/runtime/helpers/esm/extends

two different checkouts of same code resulting in two different versions of @babel/runtime for the same version of babel one version of @babel/runtime is "7.6.3" which contains commonJS module exports but another version of it is "7.9.2" which…
Ashutosh Verma
  • 309
  • 1
  • 2
  • 11
6
votes
0 answers

How to polyfill IE11 in NextJS project?

I'm trying to polyfill the project for IE11 but no matter what I do browser logs these errors: Dev mode: SCRIPT1002: Syntax error in _app.js (49004,30) 49004 const Component = props =>…
6
votes
1 answer

React Boilerplate : Uncaught RangeError: Maximum call stack size exceeded

I am getting the error of Uncaught RangeError: Maximum call stack size exceeded because of the following reason : npm.babel.e5824bbfde6f57781e4f.chunk.js:1 @babel/polyfill is loaded more than once on this page. This is probably not…
Dhaval Soni
  • 205
  • 2
  • 14
6
votes
1 answer

webpack & babel-polyfill: Can't resolve 'core-js/modules/es6.array.map' in source directory

I'm facing this error when I execute webpack: Module not found: Error: Can't resolve 'core-js/modules/es6.array.map' in '/path/to/project/src' @ ./src/index.ts 1:0-39 index.ts: console.log([1, 2, 3].map(x => x * x)); .babelrc: { "presets": [ …
legogo
  • 887
  • 1
  • 8
  • 11
6
votes
1 answer

How to reduce babel-polyfill size (150 KB minified)?

I just setup new webpack 4 project and in my main js file imported babel-polyfill import 'babel-polyfill'; And after webpack production build i analized my bandle with source-map-explorer i see such picture So babel-polyfill (core-js) took 150 Kb…
Vololodymyr
  • 1,996
  • 5
  • 26
  • 45
6
votes
0 answers

Do I still need to use babel-preset-env and Babel plugins if I am using babel-polyfill?

My understanding is that the Babel Polyfill emulates a full ES6 environment, whereas babel-preset-env compiles ES6 (and beyond) to ES5 automatically based on the environments (browsers) you need to support. I have a few questions regarding…
tomhughes
  • 4,597
  • 2
  • 24
  • 33
6
votes
2 answers

Webpack implicit vendor/manifest chunks in IE11 - Promise is undefined

Short version When I run my application in IE11, I get an error saying Promise is undefined from within the manifest.js file. How do I add babel-polyfill or similar such that it runs before the manifest is executed? Long version I am trying to add…
Matt Wilson
  • 8,159
  • 8
  • 33
  • 55
5
votes
1 answer

Switching from babel-polyfill to core-js in React app

I use babel-polyfill in my React app to transpile ECMAScript to vanilla JS. I understand babel-polyfill is now deprecated. The warning I get in my React app is: @babel/polyfill is deprecated. Please, use required parts of core-js and…
Sam
  • 26,817
  • 58
  • 206
  • 383
5
votes
1 answer

babel/polyfill is deprecated warning in create-react-app

I have a React app that I created using npx create-react-app my-app. I've been regularly updating both React and other npm packages. A while ago, I started getting the following warning: @babel/polyfill is deprecated. Please, use required parts of…
Sam
  • 26,817
  • 58
  • 206
  • 383
1
2
3
17 18