Open IngwiePhoenix opened 6 years ago
It’s unlikely since his package hasn’t had a maintainer in awhile.
Too bad. I really don't want to use generators - partially because I dont know really how they work, and as I am targeting IE11 as well, I would probably need another transpilation step "just" for the generator stuff, whilst the rest of the code uses Promises.
Anyway, here is my .babelrc
, maybe you can see the mistake that I don't.
{
"presets": [
["@babel/env", {
"targets": {
"node": "current"
}
}]
],
"plugins": [
"babel-plugin-syntax-async-functions",
"babel-plugin-async-to-promises",
["babel-plugin-module-resolver", {
"alias": {
"BIRD3": "./src"
}
}],
["@babel/plugin-proposal-class-properties", {
"loose": true
}],
["@babel/plugin-transform-react-jsx", {
"pragma": "h",
"pragmaFrag": "fragment",
"throwIfNamespace": false
}]
]
}
Note: I am testing transpiling on the CLI, and will later adapt to WebPack for more browser-specific settings and the like.
Setting the target to current node won't work in IE 11; you probably want to dial that back a ways.
@IngwiePhoenix From what I understand IE11 does not support promises. So you have two options now:- 1) Use bluebird 2) Use a babel plugin to translate promises or async await to generator functions which babel-preset-env already does.
Or, use an actual promise shim (not bluebird) - either es6-shim or core-js.
I tried getting this to work together with the
@babel/preset-env
package, but had no luck... Is Babel 7 not supported yet?