解决方式:
https://stackoverflow.com/questions/38565538/create-react-app-css-and-js-path/
在package.json中添加--- "homepage" :".",
或是直接添加文件路径,例如:"homepage":"http://example.com/react"
{
"name": "react-practice",
"version": "0.1.0",
"private": true,
"homepage": ".",
"dependencies": {}
}
本文介绍了解决Create React App中CSS和JS路径配置问题的方法。通过在package.json文件中添加homepage:.或具体URL,如homepage:http://example.com/react,可以正确配置应用的基路径,确保静态资源正确加载。
2355

被折叠的 条评论
为什么被折叠?



