【发布时间】:2018-06-27 13:58:33
【问题描述】:
我有前端应用,使用 React 编写,它使用 api-server https://koalerplate-xxxxxxx.now.sh"。
//package.json
{
...
"dependencies": {
"bulma": "^0.7.1",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-scripts": "1.1.4",
"redux": "^4.0.0",
"redux-saga": "^0.16.0"
},
"scripts": {
"start": "react-scripts start",
},
"proxy": "https://koalerplate-xxxxxxx.now.sh"
}
“npm start”,然后在浏览器中打开“localhost:3000”,一切正常。如何部署此应用程序?我必须如何申请 "proxy": "https://koalerplate-xxxxxxx.now.sh" ?我尝试使用 webpack 进行构建,得到 index.html + bundle.js,并将这两个文件上传到静态服务器,但无法正常工作.. 在 bundle.js 文件中我找不到这个代理“koalerplate-xxxxxxx.now。嘘”
【问题讨论】:
-
根据你的启动脚本,这个应用是否使用了create-react-app?
-
是的,使用 create-react-app
标签: reactjs deployment frontend