Prerender Always loads Application.js
It always loads in the application.js, is there anyway to stop it.
I tried being explicit in my application.rb:
config.react.server_renderer_options = {
files: ["common.js", "components.js"], # files to load for prerendering
replay_console: true, # if true, console.* will be replayed client-side
}
My application.js has the following:
//= require_self
//= require main
//= require react
//= require react_ujs
//=require components
But it still loads in application.js, I removed the files that had document references (main.js) in it and the pre-render now it works. I'm just wondering if there is anyway to specify what JS files are loaded for pre-rendering, so I can put in any JS I want into application.js without out it effecting the pre-render?
Sorry, I'm not sure how this happened!
specify what JS files are loaded
Yes, it's the files: option which you are using.
How can you tell that application JS is loaded for server rendering?
Also, what are the //= requires in common.js and components.js ?
2.0 will require server_rendering.js by default