vue打包报错
报错内容
当打包完浏览器报
index.html:1 Access to internal resource at ‘file:///D:/manifest.json’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.
Failed to load resource: net::ERR_FILE_NOT_FOUND
的错误时。
如图所示:
解决方法
1、找到vue.config.js文件,加入一条
publicPath: "./"
如图:
2、找到 src/router/index.js文件
将mode: 'history’去掉