问题:
项目重启之后就出现页面cannot get的问题
IDEA只给出下面信息
而控制台console报错:
Refused to load the image 'http://localhost:8082/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
如图:
有时候没报上图的信息,试多几下或换个浏览器就有上图提示了
emmmm困扰了很久
解决办法:
在项目的build目录下,找到webpack.prod.conf.js文件和webpack.dev.conf.js文件,打开后找到HtmlWebpackPlugin所在的位置,并修改成如下。重启解决。
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',