3

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?

noobie
  • 751
  • 4
  • 13
  • 33

1 Answers1

0

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"
  }
}
Matt
  • 4,029
  • 3
  • 20
  • 37
  • 1
    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` ? – noobie Oct 04 '17 at 13:49
  • Hello noobie. Have you found a way to get this done? I'm facing the same issue... – Laureant Apr 02 '18 at 06:29
  • hello noobies, have you found a way to get this done? I have the same problem – ValRob Mar 12 '19 at 07:27