There is no direct setting (that I can see) for setting the targetVersion on the transpiler. Unfortunately, it's defaulting to ES3. The only mechanism I can see to set the targetVersion is to provide a jsweetconfig.json. Unfortunately, the plugin doesn't provide a proper path, and thus, it falls back to using the 'current working directory', which is a bit of a mess within Eclipse (on my box it happened to be the Eclipse installation directory).
With the default of ES3, all sorts of errors occur when attempting to compile projects like Angular 2, which use directives that are marked experimental. If I can get it up to ES5, then the -experimentalDirectives is automatically added, and everything is happy.
Ideally, it would be great if the JSweetBuilder used the JSweetTranspiler constructor that took a configuration file, and it provided a reference to an (optional) file at the root of the project.
Here's a pull request with that (and an upgrade to the embedded JSweet):
There is no direct setting (that I can see) for setting the targetVersion on the transpiler. Unfortunately, it's defaulting to ES3. The only mechanism I can see to set the targetVersion is to provide a jsweetconfig.json. Unfortunately, the plugin doesn't provide a proper path, and thus, it falls back to using the 'current working directory', which is a bit of a mess within Eclipse (on my box it happened to be the Eclipse installation directory).
With the default of ES3, all sorts of errors occur when attempting to compile projects like Angular 2, which use directives that are marked experimental. If I can get it up to ES5, then the -experimentalDirectives is automatically added, and everything is happy.
Ideally, it would be great if the JSweetBuilder used the JSweetTranspiler constructor that took a configuration file, and it provided a reference to an (optional) file at the root of the project.
Here's a pull request with that (and an upgrade to the embedded JSweet):
16
Cheers