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

Fix config.server_bundle_js file in generator #294

Closed
justin808 opened this issue Feb 24, 2016 · 0 comments
Closed

Fix config.server_bundle_js file in generator #294

justin808 opened this issue Feb 24, 2016 · 0 comments

Comments

@justin808
Copy link
Member

We're setting the config.server_bundle_js file even if server rendering is not enabled.

https://github.com/shakacode/react_on_rails/blob/master/lib%2Fgenerators%2Freact_on_rails%2Ftemplates%2Fbase%2Fbase%2Fconfig%2Finitializers%2Freact_on_rails.rb#L7

# Shown below are the defaults for configuration
ReactOnRails.configure do |config|
  # Client bundles are configured in application.js

  # Server rendering:
  # Server bundle is a single file for all server rendering of components.
  config.server_bundle_js_file = "app/assets/javascripts/generated/server-bundle.js"

We need to templatize line 7 in that file.

Here's a crystal clear example:

https://github.com/shakacode/react_on_rails/blob/master/lib%2Fgenerators%2Freact_on_rails%2Ftemplates%2Fbase%2Fbase%2FProcfile.dev.tt

<%- if options.server_rendering? %>server: sh -c 'cd client && npm run build:dev:server'<%- end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant