-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to minify js file if class contains method named import or export #403
Comments
Looks like it doesnt support overwriding the |
Hello, @trullock Are there any plans/thoughts to address this problem? We're blocked with this issue while updating our DevExpress UI bundle to a newer version (24.*) - their code contain a couple of import/export statements which fail our minification pipelines. |
Everything is planned but i have no time, sorry. PRs welcome Tomorrow ill take a look and tell you how to fix it, we had this issue before with another keyword so the codebase has prior art for this case so should be easily extended |
Its probably the same fix as this #353 see the PR/commit that fixed it. Replicate that commit (with tests, in the same way) and see if that solves it for you |
Leaving here some details for the history: After I added import/export keywords and checked minification on my testing script (it's actually quite huge dx.all.debug.js) and indeed it helped - compilation errors were gone. However, a runtime syntax exception happened, caused by a problem described here: #410 I did changes in the script to remove the problem syntax, but another syntax error appeared: "Identifier 'u' has already been declared". JS code on this line uses clouses to access variables, so potentially this can be caused by #405 or #365 but I didn't investigate this further. So as for now, we see that we should consider other bundling/minification options. I hope someone finds this info helpful. |
Submit a pr with the import export fix and we can go from there |
Hi,
Problem occurs during minification of js file from external library. We are aware the import and export words are reserved keyword but we aren't able to change it in every new version of library files.
Code to reproduce:
Result:
The text was updated successfully, but these errors were encountered: