Answer the question
In order to leave comments, you need to log in
Set up build scripts for create react app?
There is a website written with create-react-app.
The project structure is as follows:
That is, there are two package.json files.
Build of the project must be done from the REACT FLT.BY folder (it is also the root folder).
Package.json in this folder is the following:
{
"name": "FLT",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "node server.js",
"server": "nodemon server.js",
"client": "cd client && npm run start",
"dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\"",
"build": "react-scripts build",
"main_sectionku-postbuild": "cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"aos": "^2.3.4",
"body-parser": "^1.19.0",
"concurrently": "^4.1.0",
"express": "^4.17.1",
"nodemailer": "^6.2.1",
"nodemon": "^1.19.1",
"react-addons-css-transition-group": "^15.6.2",
"react-loading-skeleton": "^1.1.2",
"react-skroll": "^0.7.2",
"react-transition-group": "^4.1.0"
}
}
Answer the question
In order to leave comments, you need to log in
You, in a good way:
1. Combine dependencies and scripts from both package.json in what is located in the client folder, and delete the root.
2. Move the contents of the client folder to the root.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question