Is there any BundleTransformer JS minifiers that supports ES6?

Is there any JS minifiers for BundleTransformer that supports EcmaScript 6? I tried to install:

  • BundleTransformer.Closure
  • BundleTransformer.YUI
  • BundleTransformer.UglifyJs

But not one of them handles the syntax of an ES6 string template, for example:

`Hello ${world}`

Am I missing something, or is it time to upgrade to Node + X?

+4
source share
1 answer

Tormod!

Suppose you have the following code:

var world = 123;
alert(`Hello ${world}`);

Only two minifiers from the Bundle Transformer can handle it:

  • MicrosoftAjaxJsMinifier BundleTransformer.MicrosoftAjax. ES6.
  • ClosureLocalJsMinifier BundleTransformer.Closure :

    <?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>
    

ES6 ES3, ES3 . , languageOutput : EcmaScript5 EcmaScript5Strict.

+2

All Articles