在项目上运行npm run build
命令react-create-app
会在所有文件(如地图文件)中创建一个构建文件夹和一些默认路径:
{"version":3,"sources":["../static/js/main.500cb0d9.js" ...
我可以更改构建文件夹中的所有路径以匹配我的 BE,例如
{"version":3,"sources":["mywebsite/web/static/js/main.500cb0d9.js" ...
包.json:
{
"name": "reactTest",
"version": "0.1.0",
"private": true,
"dependencies": {
"jquery": "^3.3.1",
"moment": "^2.22.1",
"react": "^16.4.1",
"react-datepicker": "^1.5.0",
"react-dom": "^16.4.1",
"react-month-picker": "^1.3.7",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}