Closed rohityadav225 closed 4 years ago
Interesting. I've added test for simple async syntax and it works (with Babel7 + es2017 preset), so I assume your source code is more complicated than that. Plugins support is missing though, I'll add that.
I am using babel standalone 6.26.0
, do you suggest using latest babel standalone version ? i couldn't find babel7 standalone. Also, do you have any timeline for plugins support ?
Thanks.
You can take it from any CDN, the latest one is here for example: https://unpkg.com/@babel/standalone@7.9.6/babel.min.js
I'll add simple plugins definition today/tomorrow but it will require you to include the plugin into the babel source. I have some foggy idea how to include plugins as an external context but it will require more time to experiments.
Thanks.
I am trying to define modules similar to what we do in .babelrc
. I was also planning to do something like below code so that we can disable modules.
{
"presets": [
["es2015", { "modules": false }]
]
}
I still get ReferenceError: regeneratorRuntime is not defined
even after using babel v7.9.6
, looks like i might need something like
{
"plugins": [
["transform-runtime", {
"regenerator": true
}]
]
}
I've published version 1.5
(it'll take a few minutes since it reach central).
You can add plugins with:
<plugins>['transform-runtime', {'regenerator': true}]</plugins>
I've added test for it, it works with Babel version 7.x
Thanks. I still don't see v1.5
on maven central.
I was able to use v1.5
and the transpiled file generated for me has var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
and i get require is not defined
error.
You need to use module loader in your code. Or switch Babel to use systemjs
. There should be a plugin for this.
When i try to use
async/await
feature, i getUncaught ReferenceError: regeneratorRuntime is not defined
error message. I guess i have to add@babel/plugin-transform-runtime
plugin but i am not sure how to add the babel plugins usingbabel-maven-plugin
. can you please let me knowMy presets are
<presets>es2015,es2016,es2017</presets>