|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +# See https://github.com/shakacode/react_on_rails/blob/master/docs/basics/configuration.md |
| 4 | +# for many more options. |
| 5 | + |
| 6 | +ReactOnRails.configure do |config| |
| 7 | + # This configures the script to run to build the production assets by webpack. Set this to nil |
| 8 | + # if you don't want react_on_rails building this file for you. |
| 9 | + # If nil, then the standard rails/webpacker assets:precompile will run |
| 10 | + # config.build_production_command = nil |
| 11 | + |
| 12 | + ################################################################################ |
| 13 | + ################################################################################ |
| 14 | + # TEST CONFIGURATION OPTIONS |
| 15 | + # Below options are used with the use of this test helper: |
| 16 | + # ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config) |
| 17 | + ################################################################################ |
| 18 | + |
| 19 | + # If you are using this in your spec_helper.rb (or rails_helper.rb): |
| 20 | + # |
| 21 | + # ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config) |
| 22 | + # |
| 23 | + # with rspec then this controls what yarn command is run |
| 24 | + # to automatically refresh your webpack assets on every test run. |
| 25 | + # |
| 26 | + # Alternately, you can remove the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets` |
| 27 | + # and set the config/webpacker.yml option for test to true. |
| 28 | + config.build_test_command = "RAILS_ENV=test bin/webpack" |
| 29 | + |
| 30 | + ################################################################################ |
| 31 | + ################################################################################ |
| 32 | + # SERVER RENDERING OPTIONS |
| 33 | + ################################################################################ |
| 34 | + # This is the file used for server rendering of React when using `(prerender: true)` |
| 35 | + # If you are never using server rendering, you should set this to "". |
| 36 | + # Note, there is only one server bundle, unlike JavaScript where you want to minimize the size |
| 37 | + # of the JS sent to the client. For the server rendering, React on Rails creates a pool of |
| 38 | + # JavaScript execution instances which should handle any component requested. |
| 39 | + # |
| 40 | + # While you may configure this to be the same as your client bundle file, this file is typically |
| 41 | + # different. You should have ONE server bundle which can create all of your server rendered |
| 42 | + # React components. |
| 43 | + # |
| 44 | + config.server_bundle_js_file = "hello-world-bundle.js" |
| 45 | +end |
0 commit comments