今天使用 npm run build 将项目打包到 dist 后放到线上去,访问的时候居然是白屏,但是所有的资源路径都是 200,在开发的时候是正常的。
解决方式是将router/index.js
中的mode: 'history'
删掉,而这个 mode 的默认值是 hash。
重新打包就好了。
今天使用 npm run build 将项目打包到 dist 后放到线上去,访问的时候居然是白屏,但是所有的资源路径都是 200,在开发的时候是正常的。
解决方式是将router/index.js
中的mode: 'history'
删掉,而这个 mode 的默认值是 hash。
重新打包就好了。