我在使用webpack运行应用程序时遇到问题,我出现了以下错误:
URIError: Failed to decode param '/%PUBLIC_URL%/manifest.json'
at decodeURIComponent (<anonymous>)
我试图解决像为favicon解决的问题,但它对我不起作用
plugins: [
new HtmlWebpackPlugin({
favicon: "./public/favicon.ico",
filename: "index.html",
manifest: "./public/manifest.json"
})
],
我希望索引文件可以读取/%PUBLIC_URL%/的值。我该怎么办?
这样配置webpack之后:
HtmlWebpackPlugin ({
favicon: "./public/favicon.ico",
filename: "index.html",
manifest: "./public/manifest.json"
}).
在index.html:中留下这样的清单链接
<link rel = "manifest" href = "manifest.json" />
它对我有效。