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

Polyfills for example Promise is not included automatically? #56

Open
kolomu opened this issue Apr 17, 2020 · 0 comments
Open

Polyfills for example Promise is not included automatically? #56

kolomu opened this issue Apr 17, 2020 · 0 comments

Comments

@kolomu
Copy link

kolomu commented Apr 17, 2020

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant