4

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?

1 Answer 1

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"
  }
}
Sign up to request clarification or add additional context in comments.

3 Comments

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 ?
Hello noobie. Have you found a way to get this done? I'm facing the same issue...
hello noobies, have you found a way to get this done? I have the same problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.