How to generate bundle.js for existing react app c

2019-07-06 04:47发布

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条回答
Deceive 欺骗
2楼-- · 2019-07-06 05:44

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"
  }
}
查看更多
登录 后发表回答