-
Notifications
You must be signed in to change notification settings - Fork 755
components.js generated by assets:precompile is not used #212
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
Comments
I don't know of a built-in way to do it! You can see the lambda used for getting the JS source code as a string here: https://github.com/reactjs/react-rails/blob/master/lib/react/rails/railtie.rb#L66-L70 You could accomplish your goal by modifying the config to use https://github.com/reactjs/react-rails/blob/master/lib/react/rails/railtie.rb#L66 Then you could pass your own |
Okay I'll work on a PR then. Thanks |
…e is not used: allow user to override the components_js lamdba
PR opened. Let me know if it needs any changes. #213 |
…e is not used: allow user to override the components_js lamdba
This should be fixed in the latest react-rails (it uses the sprockets manifest in production). Hopefully we can get that other PR for SprocketsRenderer worked out! |
In my setup, our production environment does not have any asset-related gems and cannot compile any assets.
When I try to render a component using
prerender: true
the gem tries to useapp.assets
to find thecomponents.js
file but since production doesn't have the asset pipeline configuration, it just gets the plain file contents, which in my case in ES6 unbrowserified but could be coffee for some people or whatever else.Is there a simple way to have sprockets fetch it from public/assets? I tried a naive approach and it complained I was trying to retrieve a file outside of the asset load paths.
The text was updated successfully, but these errors were encountered: