Jana
Jana

Reputation: 11

How to run the npm run build, when frontend (ReactJS) and backend (NodeJs,Express) are in two different folders

My file structure would look something like:

./client

 .react

./server

 .express

.express and .react are just shorthand for all of my files in these folders. So I have separate node_modules folders for each of these directories.

Upvotes: 1

Views: 2429

Answers (3)

Zain ul abideen
Zain ul abideen

Reputation: 146

This same happen to me when I worked on the good solution is to make top level on these two workspaces. Just visit the given url workspaces you will get the idea how to manage that kind of flow and single top level package.json

Upvotes: 1

Jamie Kai Remkes
Jamie Kai Remkes

Reputation: 11

I wouldn't do it with npm itself. It might be handy to create a Makefile in the root, running your required build steps.

This article explains how to create a Makefile.

Upvotes: 1

Ashish Bhangade
Ashish Bhangade

Reputation: 137

You need to use npm run build to build the react app

Upvotes: 0

Related Questions