Skip to content

Import instead of require for es6.promise  #6601

@babel-bot

Description

@babel-bot

Issue originally reported by @sheerun in babel/babel-preset-env#433

I use both babel and babel-preset-env beta.2.

My .babelrc:

{
  "presets": [
    ["env", {
      "target": {
        "node": "4"
      },
      "useBuiltIns": "usage",
      "debug": true
    }]
  ]
}

Resulting start of compiled .js file:

#!/usr/bin/env node
"use strict";

import "babel-polyfill/lib/core-js/modules/es6.promise";

require("babel-polyfill/lib/core-js/modules/es6.symbol");

require("babel-polyfill/lib/core-js/modules/web.dom.iterable");

require("babel-polyfill/lib/regenerator-runtime/runtime");

require("babel-polyfill/lib/core-js/modules/es6.string.starts-with");

I suspect this might be because regenerator-runtime is added? But really, I have no idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    importedoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: preset-env

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions