问题描述
/html/pages/test.html
/assets/img/photo_small.png
/assets/img/photo_big.png
<a href="../../assets/img/photo_big.png">
<img src="../../assets/img/photo_small.png">
</a>
-
IMG SRC 使用的图片:
-
net::ERR_FILE_NOT_FOUND
在我的 webpack conf 中:
module: {
rules: [
{
test: /\.(gif|png|jpe?g|svg|webp)$/i,type: 'asset/resource'
},{
test: /\.html$|njk|nunjucks/,use: [
{
loader: 'html-loader',options: {
sources:true
},},{
loader: 'nunjucks-html-loader',}
]
]
},plugins: [
new HtmlWebpackPlugin({
filename: 'test.html',inject: 'body',template: './src/html/pages/test.html'
}),]
如何在没有 copyWebpackPlugin
的情况下修复它,只是让 disT 文件夹中仅使用文件?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)