-
Notifications
You must be signed in to change notification settings - Fork 752
Description
I'm attempting to convert a large Rails app from the Asset Pipeline to Webpacker. Instead of a single application.js, there are a number of different top-level JavaScript entry points (dashboard.js, admin.js, etc.). I have two questions:
- Is it possible to configure
react-railsto use the bundled version of React in the asset pipeline for one top-level JS file (asset pipeline manifest) and use the webpack version for another (pack tag)? - If not, is it possible to force
react-railsto use the asset pipeline/bundled React JS even if you have React installed viayarnwith Webpack?
I'm trying to find a way to keep parts of the app running under the current react-rails asset pipeline configuration but as soon as I run rails webpacker:install:react, the existing react-rails stuff breaks with Uncaught ReferenceError: React is not defined.
To be clear, the part of the app using the asset pipeline is only has standard stylesheet_link_tags (no pack tags). Yet react-rails is still loading the Webpack (module) version of React, not the bundled version. Is there a way to instruct it to load from one or the other?
Thanks in advance for your help. This is a tricky migration.