0

my project consists of a react frontend and an express backend. It has the following hierarchy:

project\

  • package.json
  • server.js
  • node_modules\
  • client\
    • package.json
    • src\
    • public\
    • node_modules\

I know that running npm run build inside the client folder will run react-scripts build (as stated in its package.json) that will bundle all the client folder contents for deployment.

I have several questions regarding this:

  • how do i do bundling like using react-scripts start but in the project folder?
  • is it ideal to have duplicates of package.json and node_modules, one for client and one for project folder?
kabison33
  • 101
  • 2
  • 10
  • Could you be more specific with a single question? Yes you can define a build script in the root package file, for example. – jonrsharpe Aug 10 '20 at 17:52
  • Take a look at https://stackoverflow.com/questions/36172442/how-can-i-get-npm-start-at-a-different-directory – GitGitBoom Aug 10 '20 at 21:04

0 Answers0