针对html-loader版本问题的报错~
const path = require('path')
module.exports = {
module: {
rules: [
{
test: /.html$/,
use: {
loader: 'html-loader',
options: {
// html-loader 0.5.5 版本可以写为如下方式
attrs: ['img:src', 'a:href'],
// html-loader 1.3.2 版本需写为对象形式
attributes: {
list: [
{
tag: 'img',
attribute: 'src',
type: 'src'
},
{
tag: 'a',
attribute: 'href',
type: 'src'
}
]
}
}
}
}
]
}
}
标签:src,heml,href,attribute,module,loader,webpack,html
来源: https://blog.csdn.net/qq_43984284/article/details/110750033