Fetch and undefined headers in IE11.0.9600 with babel-polyfill when process.env.NODE_ENV == 'production'

When process.env.NODE_ENV=='development'- this is normal!

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: "^1.5.2",
babel-preset-es2015: "^6.16.0",
babel-preset-es2016: "^6.22.0",
babel-preset-es2017: "^6.16.0",
babel-preset-react: "^6.16.0",
babel-preset-stage-0: "^6.22.0"
...

dependencies:

...
babel-polyfill: "^6.16.0"
...

.babelrc:

{
    "presets": [
        "react",
        ["env", {
             "useBuiltIns": true
        }],
        "stage-0"
    ]
}

Try "useBuiltIns": false, es2016, es2015, es2017 presets. Nothing changes.

index.js:

"use strict";
import 'babel-polyfill'
...

webpack.config module.exports.entry:

vendor: ['babel-polyfill', 'immutable', 'react', 'react-dom', ...],
...
bundle: [path.resolve(__dirname, srcPath + ""index.js)]

the provider is the first script in index.html.

Typing _babelPolyfill in ie console returns true. But headers, selections are undefined ...

Why process.env.NODE_ENV=='production'broke my application in IE11? How to fix my configuration?

+4
1

core.js polyfill () , babel- polyfill . :

:

https://github.com/zloirock/core-js

?

+2

Source: https://habr.com/ru/post/1679743/


All Articles