HtmlWebpackPlugin:无法加载文件 favicon.ico?

问题描述

new HtmlWebpackPlugin({
        filename: `index.html`
        template: `public/index.html`,favicon: "../public/favicon.ico",name: 'index',inject: true
    })

为什么 HtmlWebpackPlugin 没有加载文件 favicon.ico

解决方法

new HtmlWebpackPlugin({
    filename: `index.html`
    template: `public/index.html`,favicon: "public/favicon.ico",name: 'index',inject: true
})

.ico 文件的相对路径错误。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...