简体   繁体   中英

How to seperate React application from Ruby on Rails created with webpack configuration?

I found an open source Ruby on Rails project that is created with command rails new myapp --webpack=react but I am only interested in the React part. How can I seperate it from the rest and enable it to run on its own?

The link to repo: https://github.com/vigetlabs/storyboard

For what I have done so far; React related files reside in directory ./app/javascript/pack/ but npm script triggers Ruby application first. Ruby, somehow, starts the React application. This is how far I could come.

  1. use create-react-app to create a new react app.
  2. copy and paste /app/javascript/src to the newly created react app. maybe packs folder too.
  3. copy over the package.json file content to get all packages.
  4. do some testing/debugging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM