jarslab/babel-maven-plugin

Q: how exactly it works?

Closed this issue · 3 comments

Hi,

thank you for the plugin!

I'm definitely going to try it but I don't understand how it works. I see that the plugin executes JS code with ScriptEngine (Nashhorn as far I understand):

private static final String BABEL_EXECUTE = "Babel.transform(%s, {presets: [%s]}).code";

But it's not clear from where Babel.transform() function is came from. The plugin doesn't have dependency on babel webjar and there is no recommendation that I should include it either.

Could you, please, explain this moment and perhaps document it?

Thank you!

Ah, I found it:

babelSrc - readable path to standalone(!) Babel sources. It can be provided from WebJars dependency, minified or development version,

P.S. Perhaps, README.md could be updated to show the example of using it with WebJars? Just an idea.