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:
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"
}
}