This is the initial set up React in the Content Library. Would like some feedback on the project set up.
I created a /react folder where all the react stuff lives. When you start up: npm run watch, it will now load both Express and React. I didn't change the old Express port so you can still access all the old stuff in localhost:3000. The React stuff is on localhost:3001.
I created a build step on the React project that will copy the stuff over to the Express /public folder. If you want to try, just do this:
cd react
yarn build -> Copies the react build output to ../public
cd .. && npm run watch
Go to: http://localhost:3000/index.html <- The build output of React will be copied here.
Related Issue
Motivation and Context
Checklist
[ ] Ran npm run lint and updated code style accordingly
[ ] npm run test passes
[ ] PR has a description and all contributors/stakeholder are noted/cc'ed
[ ] tests are updated and/or added to cover new code
[ ] relevant documentation is changed and/or added
Description of Change
This is the initial set up React in the Content Library. Would like some feedback on the project set up.
I created a /react folder where all the react stuff lives. When you start up:
npm run watch
, it will now load both Express and React. I didn't change the old Express port so you can still access all the old stuff in localhost:3000. The React stuff is on localhost:3001.I created a build step on the React project that will copy the stuff over to the Express /public folder. If you want to try, just do this:
cd react
yarn build
-> Copies the react build output to ../publiccd .. && npm run watch
http://localhost:3000/index.html
<- The build output of React will be copied here.Related Issue
Motivation and Context
Checklist
npm run lint
and updated code style accordinglynpm run test
passes