Closed ghost closed 3 years ago
Hello, Jules!
I recommend that you start using the BundleTransformer.NUglify module.
I have a similar issue NUglify.
I created a console app with NUglify and minified this script :
new Vue({
data() {
return {
message: ''
}
}
});
The console app works
static async Task Main(string[] args)
{
string js = await File.ReadAllTextAsync("./script.js");
var result = Uglify.Js(js);
Console.WriteLine(result.Code); // outputs new Vue({data(){return{message:""}}})
}
The Bundler throws an error for the same script
Message: Implicit property name must be identifier: data() { return { message: '' }; } Error code: JS1314 Severity: 0 Subcategory: run-time File: /Scripts/vue.js Start line: 2 Start column: 5 End line: 6 End column: 6
The console app works
You just don't process the Errors
property from returned result.
Try to add in the Web.config
file the following setting:
<configuration>
…
<bundleTransformer …>
…
<nuglify>
<js ignoreErrorList="JS1314" />
…
</nuglify>
…
</bundleTransformer>
…
</configuration>
It is working. Thanks for the help.
The current version of UglifyJS (2.8.29) does not support ES2017 (await, async). The support start with UglifyJS 3.0.17. https://github.com/mishoo/UglifyJS/issues/1789
Is there any plan to support the newer version of UglifyJS ? Or any support of ES2017 with the other transformers ?