My React.js app was created with this mand:
npx create-react-app my-app
Now how can I convert this script section in package.json to run the app without react-scripts?
"scripts": {
"start": "NODE_ENV=development node_modules/react-scripts/bin/react-scripts.js start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Should it be something like:
node index.js
How do I convert each option in that scripts section? Thanks
My React.js app was created with this mand:
npx create-react-app my-app
Now how can I convert this script section in package.json to run the app without react-scripts?
"scripts": {
"start": "NODE_ENV=development node_modules/react-scripts/bin/react-scripts.js start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Should it be something like:
node index.js
How do I convert each option in that scripts section? Thanks
Share asked Jul 29, 2022 at 21:46 John GlabbJohn Glabb 1,6138 gold badges31 silver badges64 bronze badges 2- What is the purpose of this? – Konrad Commented Jul 29, 2022 at 21:47
- 1 the whole pany applications should be converted.. They do not want to use react-scripts due to some vulnerability issues in react-scripts dependencies – John Glabb Commented Aug 1, 2022 at 1:26
2 Answers
Reset to default 4When you create a React app with npx create-react-app my-app
you make your react app dependant of react-scripts.
If you no longer want to use this react-scripts who give you a lot of help you can follow this tutorial from the official documentation to eject yourself.
But you can't remove the dependency from an existing project, maybe you are considering to make a new one, and this tutorial will help you to achieve it !
Good thing to do would be to migrate to Vite or Parcel. Or use a Production-grade react framework like Gatsby or Nest.js. You can lean more from here React without a framework.