bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
194 stars 92 forks source link

ES5 mode stops working in 3.0.2 #217

Closed aibolit closed 6 years ago

aibolit commented 6 years ago

In my build.gradle I have

    minifyOptions = [
        languageMode: 'ES6',
        targetLanguage: 'ES5'
    ]

It used to minify to ES5 code in 3.0.1 and doesn't do so in 3.0.2

For example

var test = () => {return 'hello';};

In 3.0.1 I get

//# sourceMappingURL=test.js.map
var process=process||{env:{NODE_ENV:"development"}},test=function(){return"hello"};

In version 3.0.2 I get

//# sourceMappingURL=test.js.map
'use strict';var process=process||{env:{NODE_ENV:"development"}};var test=()=>{return"hello"};

Notice the arrow function is not valid ES5

davydotcom commented 6 years ago

this functionality was removed in favor of the new native ES6 processing as part of babelJs...

Please refer to the documentation for more information on the adjustments needed

http://www.asset-pipeline.com/manual/index.html#ecmascript-2017-2018-beyond