一.Vue 项目打包后运行index.html显示空白
在vue.config.js文件中module.exports里添加或修改配置
publicPath: './', //解决打包环境文件引入报错
如果还是空白则查看路由模式在router.js中将history改为hash
const router = new Router({
mode: 'hash',
// mode: 'history',
routes,
});
重新打包运行即可
二.React 项目打包后运行index.html显示空白
在package.json里面添加这么一行代码:
"homepage": "."
重新打包运行即可