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

Precompile for production #263

Closed
SqueezedLight opened this issue Feb 9, 2016 · 3 comments
Closed

Precompile for production #263

SqueezedLight opened this issue Feb 9, 2016 · 3 comments

Comments

@SqueezedLight
Copy link
Contributor

Hi guys,
first of all thanks for your great work!
Currently i'm having a hard time precompiling assets for production. As far as i understand, webpack builds the client side code to /app/assets/javascripts/generated where sprockets picks it up. If i run rake assets:precompile on a fresh react_on_rails project the resulting application.js in /public/assets has nearly 2Mb?! What am i missing? Unfortunately i couldn't find documentation that covers this topic.

Any help is greatly appreciated.

@justin808
Copy link
Member

Please see:

https://github.com/shakacode/react_on_rails/blob/master/docs%2Fadditional_reading%2Fheroku_deployment.md

and https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/lib%2Ftasks%2Fassets.rake

In terms of the size of the file, I'm not surprised that it's big, depending on what libraries are included.

It should be cached in the browser, and TurboLinks will allow loading it once.

We also plan to use:

CC: @alexfedoseev @robwise

@SqueezedLight
Copy link
Contributor Author

Hi, thanks for your quick support. Unfortunately this is not very satisfying as i already removed lodash completely. I will definitely have a look into tree shaking. I think its worth shaving off every kB we can. After posting this issue i found most of my thoughts summed up in this issue - quite helpful: #206

@justin808
Copy link
Member

Hi @SqueezedLight, please let us know what you find!

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