Skip to content
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

Uglify 4 having problems with ES6 assets, while 3 works fine #162

Open
LucasArruda opened this issue Apr 18, 2019 · 3 comments
Open

Uglify 4 having problems with ES6 assets, while 3 works fine #162

LucasArruda opened this issue Apr 18, 2019 · 3 comments

Comments

@LucasArruda
Copy link

Not really understanding what is going on. Perhaps someone can elucidate me on what are the big changes from 3 to 4, but Uglify 3 seems to ignore or not really process webpack files with const on it, while 4 promptly fails.

I know there is this setting to enable ES6 (harmony: true) but I don't want to use something experimental and also lose mangle/compression, which is really important.

Maybe I just need to remove those Javascript files from assets.rb, though I am using them within the app. So not sure that would be ideal.

@matissg
Copy link

matissg commented May 12, 2019

@LucasArruda Same here. v.3.2 works, however v.4.1.20 throw an error when I do push to my Dokku container - gives me Precompiling assets failed . Would be happy to use the latest gem version, but don't what's wrong...

@LucasArruda
Copy link
Author

It seems that there is a way to prevent that, which is also getting latest sprockets, with come with ES6 support.

But, there is a caveat. You have to rename all your ES6 files to .es6 extension, which makes this also problematic since you can't rename other projects, dependencies. I also have multiple projects inside my rails app, which makes this whole process of renaming very problematic.

@LucasArruda
Copy link
Author

I want that all (uglifier 4, new sprockets) and for that I'm willing to open a PR on sprockets to fix that when I do have some time. That will also allow usage of webpacker + uglifier 4 (because with sprockets transpiling with babel, uglifier won't have to know about ES6 for now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants