Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Polyfills for example Promise is not included automatically? #56

@kolomu

Description

@kolomu

Hello, I tried the TypeScript-Babel-Starter setup. For some reason polyfills are not automatically included.

Am I missing something here? I thought that is the point of using babel.

Example:

function main() {
    return new Promise((resolve) => resolve("yes!"));
}

main();

Result:

function main() {
  return new Promise(function (resolve) {
    return resolve("yes!");
  });
}

main();

I haven't changed the file .babelrc / .tsconfig.

But also when adding in .babelrc the following preset it won't use Promise polyfill.

    [
      "@babel/preset-env",
      {
        "useBuiltIns": "entry"
      }
    ]

(also included a browserslist with IE11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions