Are there any JS minifiers for BundleTransformer that support EcmaScript 6? I have tried installing:
But neither seem to handle the string template syntax of ES6, such as:
`Hello ${world}`
Am I missing something, or is it time to upgrade to Node + X?
Tormod!
Suppose you have the following code:
var world = 123;
alert(`Hello ${world}`);
Only two minifiers from the Bundle Transformer can process it:
MicrosoftAjaxJsMinifier
from BundleTransformer.MicrosoftAjax. It just minify a ES6 code.ClosureLocalJsMinifier
from BundleTransformer.Closure with the following configuration settings:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
…
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
…
<closure>
<js>
…
<local closureCompilerApplicationPath="…"
javaVirtualMachinePath="…"
languageInput="EcmaScript6" languageOutput="EcmaScript3" />
…
</js>
</closure>
…
</bundleTransformer>
…
</configuration>
The transpilation from ES6 to ES3 will be made, and then the ES3 code will be minified. In addition, to the languageOutput
attribute can be set the following values: EcmaScript5
and EcmaScript5Strict
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With