babel / babel-preset-env

PSA: this repo has been moved into babel/babel -->

Home Page:https://github.com/babel/babel/tree/master/packages/babel-preset-env

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IE 10 Map not work

xiaoDC opened this issue · comments

I use babel-preset-env and config as follow

  "presets": [
    "react",
    ["env", {
      "targets": {
        "browsers": [
          "last 2 versions",
          "ie >= 9"
        ]
      },
      "useBuiltIns": true,
      // "include": ["es6.map"],
      "debug": true
    }]
  ],

and

import "core-js"

the plugins and polyfills ars

Using targets:
{
  "chrome": "59",
  "android": "4.4.3",
  "edge": "14",
  "firefox": "54",
  "ie": "9",
  "ios": "10",
  "safari": "10"
}

Modules transform: commonjs

Using plugins:
  check-es2015-constants {"android":"4.4.3","ie":"9"}
  transform-es2015-arrow-functions {"android":"4.4.3","ie":"9"}
  transform-es2015-block-scoped-functions {"android":"4.4.3","ie":"9"}
  transform-es2015-block-scoping {"android":"4.4.3","ie":"9"}
  transform-es2015-classes {"android":"4.4.3","ie":"9"}
  transform-es2015-computed-properties {"android":"4.4.3","ie":"9"}
  transform-es2015-destructuring {"android":"4.4.3","edge":"14","ie":"9"}
  transform-es2015-duplicate-keys {"android":"4.4.3","ie":"9"}
  transform-es2015-for-of {"android":"4.4.3","edge":"14","ie":"9"}
  transform-es2015-function-name {"android":"4.4.3","edge":"14","ie":"9"}
  transform-es2015-literals {"android":"4.4.3","ie":"9"}
  transform-es2015-object-super {"android":"4.4.3","ie":"9"}
  transform-es2015-parameters {"android":"4.4.3","ie":"9"}
  transform-es2015-shorthand-properties {"android":"4.4.3","ie":"9"}
  transform-es2015-spread {"android":"4.4.3","ie":"9"}
  transform-es2015-sticky-regex {"android":"4.4.3","ie":"9"}
  transform-es2015-template-literals {"android":"4.4.3","ie":"9"}
  transform-es2015-typeof-symbol {"android":"4.4.3","ie":"9"}
  transform-es2015-unicode-regex {"android":"4.4.3","ie":"9"}
  transform-regenerator {"android":"4.4.3","ie":"9"}
  transform-exponentiation-operator {"android":"4.4.3","ie":"9","ios":"10","safari":"10"}
  transform-async-to-generator {"android":"4.4.3","edge":"14","ie":"9","ios":"10","safari":"10"}
  syntax-trailing-function-commas {"android":"4.4.3","ie":"9"}

Using polyfills:
  es6.typed.array-buffer {"android":"4.4.3","ie":"9"}
  es6.typed.data-view {"ie":"9"}
  es6.typed.int8-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint8-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint8-clamped-array {"android":"4.4.3","ie":"9"}
  es6.typed.int16-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint16-array {"android":"4.4.3","ie":"9"}
  es6.typed.int32-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint32-array {"android":"4.4.3","ie":"9"}
  es6.typed.float32-array {"android":"4.4.3","ie":"9"}
  es6.typed.float64-array {"android":"4.4.3","ie":"9"}
  es6.map {"android":"4.4.3","edge":"14","ie":"9"}
  es6.set {"android":"4.4.3","edge":"14","ie":"9"}
  es6.weak-map {"android":"4.4.3","edge":"14","ie":"9"}
  es6.weak-set {"android":"4.4.3","edge":"14","ie":"9"}
  es6.reflect.apply {"android":"4.4.3","ie":"9"}
  es6.reflect.construct {"android":"4.4.3","ie":"9"}
  es6.reflect.define-property {"android":"4.4.3","ie":"9"}
  es6.reflect.delete-property {"android":"4.4.3","ie":"9"}
  es6.reflect.get {"android":"4.4.3","ie":"9"}
  es6.reflect.get-own-property-descriptor {"android":"4.4.3","ie":"9"}
  es6.reflect.get-prototype-of {"android":"4.4.3","ie":"9"}
  es6.reflect.has {"android":"4.4.3","ie":"9"}
  es6.reflect.is-extensible {"android":"4.4.3","ie":"9"}
  es6.reflect.own-keys {"android":"4.4.3","ie":"9"}
  es6.reflect.prevent-extensions {"android":"4.4.3","ie":"9"}
  es6.reflect.set {"android":"4.4.3","ie":"9"}
  es6.reflect.set-prototype-of {"android":"4.4.3","ie":"9"}
  es6.promise {"android":"4.4.3","ie":"9"}
  es6.symbol {"android":"4.4.3","edge":"14","ie":"9"}
  es6.object.assign {"android":"4.4.3","ie":"9"}
  es6.object.is {"ie":"9"}
  es6.object.set-prototype-of {"android":"4.4.3","ie":"9"}
  es6.function.name {"android":"4.4.3","edge":"14","ie":"9"}
  es6.string.raw {"android":"4.4.3","ie":"9"}
  es6.string.from-code-point {"android":"4.4.3","ie":"9"}
  es6.string.code-point-at {"android":"4.4.3","ie":"9"}
  es6.string.repeat {"android":"4.4.3","ie":"9"}
  es6.string.starts-with {"android":"4.4.3","ie":"9"}
  es6.string.ends-with {"android":"4.4.3","ie":"9"}
  es6.string.includes {"android":"4.4.3","ie":"9"}
  es6.regexp.flags {"android":"4.4.3","edge":"14","ie":"9"}
  es6.regexp.match {"android":"4.4.3","edge":"14","ie":"9"}
  es6.regexp.replace {"android":"4.4.3","edge":"14","ie":"9"}
  es6.regexp.split {"android":"4.4.3","edge":"14","ie":"9"}
  es6.regexp.search {"android":"4.4.3","edge":"14","ie":"9"}
  es6.array.from {"android":"4.4.3","edge":"14","ie":"9"}
  es6.array.of {"android":"4.4.3","ie":"9"}
  es6.array.copy-within {"android":"4.4.3","ie":"9"}
  es6.array.find {"android":"4.4.3","ie":"9"}
  es6.array.find-index {"android":"4.4.3","ie":"9"}
  es6.array.fill {"android":"4.4.3","ie":"9"}
  es6.array.iterator {"android":"4.4.3","ie":"9"}
  es6.number.is-finite {"ie":"9"}
  es6.number.is-integer {"android":"4.4.3","ie":"9"}
  es6.number.is-safe-integer {"android":"4.4.3","ie":"9"}
  es6.number.is-nan {"ie":"9"}
  es6.number.epsilon {"android":"4.4.3","ie":"9"}
  es6.number.min-safe-integer {"android":"4.4.3","ie":"9"}
  es6.number.max-safe-integer {"android":"4.4.3","ie":"9"}
  es6.math.acosh {"android":"4.4.3","ie":"9"}
  es6.math.asinh {"android":"4.4.3","ie":"9"}
  es6.math.atanh {"android":"4.4.3","ie":"9"}
  es6.math.cbrt {"android":"4.4.3","ie":"9"}
  es6.math.clz32 {"android":"4.4.3","ie":"9"}
  es6.math.cosh {"android":"4.4.3","ie":"9"}
  es6.math.expm1 {"android":"4.4.3","ie":"9"}
  es6.math.fround {"android":"4.4.3","ie":"9"}
  es6.math.hypot {"android":"4.4.3","ie":"9"}
  es6.math.imul {"android":"4.4.3","ie":"9"}
  es6.math.log1p {"android":"4.4.3","ie":"9"}
  es6.math.log10 {"android":"4.4.3","ie":"9"}
  es6.math.log2 {"android":"4.4.3","ie":"9"}
  es6.math.sign {"android":"4.4.3","ie":"9"}
  es6.math.sinh {"android":"4.4.3","ie":"9"}
  es6.math.tanh {"android":"4.4.3","ie":"9"}
  es6.math.trunc {"android":"4.4.3","ie":"9"}
  es7.array.includes {"android":"4.4.3","ie":"9"}
  es7.object.values {"android":"4.4.3","ie":"9","ios":"10","safari":"10"}
  es7.object.entries {"android":"4.4.3","ie":"9","ios":"10","safari":"10"}
  es7.object.get-own-property-descriptors {"android":"4.4.3","edge":"14","ie":"9","ios":"10","safari":"10"}
  es7.string.pad-start {"android":"4.4.3","edge":"14","ie":"9"}
  es7.string.pad-end {"android":"4.4.3","edge":"14","ie":"9"}
  web.timers {"chrome":"59","android":"4.4.3","edge":"14","firefox":"54","ie":"9","ios":"10","safari":"10"}
  web.immediate {"chrome":"59","android":"4.4.3","edge":"14","firefox":"54","ie":"9","ios":"10","safari":"10"}
  web.dom.iterable {"chrome":"59","android":"4.4.3","edge":"14","firefox":"54","ie":"9","ios":"10","safari":"10"}

But in IE 10, the window.Map is undefined

I believe you're meant to do import "babel-polyfill"; currently, not import "core-js"; according to the docs: https://github.com/babel/babel-preset-env#usebuiltins

@loganfsmyth I change import "core-js" to import "babel-polyfill" , and also the window.Map is undefined.

Using polyfills:
  es6.typed.array-buffer {"android":"4.4.3","ie":"9"}
  es6.typed.data-view {"ie":"9"}
  es6.typed.int8-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint8-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint8-clamped-array {"android":"4.4.3","ie":"9"}
  es6.typed.int16-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint16-array {"android":"4.4.3","ie":"9"}
  es6.typed.int32-array {"android":"4.4.3","ie":"9"}
  es6.typed.uint32-array {"android":"4.4.3","ie":"9"}
  es6.typed.float32-array {"android":"4.4.3","ie":"9"}
  es6.typed.float64-array {"android":"4.4.3","ie":"9"}
  es6.map {"android":"4.4.3","edge":"14","ie":"9"}
  ...

so I don't know what happend

@xiaoDC can you put up a small repo/example with the bug?

@existentialism I have resolve the problem,thank you!