This question is related to this SO post. I'm using create-react-app CLI for my project. It is a small scale web app which I start (locally) by npm start and it appears on browser. Now I need to generate a bundle.js file of my entire web app so that it can be used with Adobe Phonegap. How do I do that with my existing app?
Add a comment
|
1 Answer
react-scripts build should do it. Add a build field to the scripts section of your package.json file and then run npm run build. Example:
{
"repository": {
...
},
...
"dependencies": {
...
}
"scripts" : {
...
"build" : "react-scripts build"
}
}
3 Comments
noobie
I already tried this command. It (
"build" : "react-scripts build" ) was already present. Doing npm run build generates a main.719b280e.js file inside ./build/static/js/ (Newly Created). Is it same as build.js ?Laureant
Hello noobie. Have you found a way to get this done? I'm facing the same issue...
ValRob
hello noobies, have you found a way to get this done? I have the same problem