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

Exclude react component names to get minified #107

Closed
nextofsearch opened this issue Feb 13, 2017 · 4 comments
Closed

Exclude react component names to get minified #107

nextofsearch opened this issue Feb 13, 2017 · 4 comments

Comments

@nextofsearch
Copy link

Hi,

Is there anyway to exclude react component names to get minified?

Thanks,

@nextofsearch
Copy link
Author

nextofsearch commented Feb 13, 2017

I tried both options but the web server gets hung

config.assets.js_compressor = Uglifier.new(keep_fnames: true)

config.assets.js_compressor = Uglifier.new(mangle: {keep_fnames: true})

What would be the correct options?

@lautis
Copy link
Owner

lautis commented Feb 17, 2017

What does the input JS for Uglifier after Babel (if used) look like? This might depend a bit on how you're writing your JS and what's your ES6 to ES5 compilation setup.

@andyklimczak
Copy link

Running into same thing with es6 syntax for react-rails. reactjs/react-rails#668 is probably related to this.

Apologies if not!

@lautis
Copy link
Owner

lautis commented Apr 9, 2017

There's now ES6 syntax support with the (experimental) harmony flag. In Rails application.rb, add config.assets.js_compressor = Uglifier.new(harmony: true).

@lautis lautis closed this as completed Apr 9, 2017
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

3 participants