Closed YujieCheng closed 4 years ago
config in webpack.js
module: { rules: [ { test: /\.html$/, use: [ "file-loader?name=[name].[ext]", "extract-loader", "html-loader" ] }, { test: /\.(png|gif|jpg)$/, use: [ { loader: "file-loader", options: { name: utils.assetsPath('img/[name].[ext]') } } ] } ] }
next code is I want to handle
<body> <img src="imgs/wechat.jpg"> <img src="imgs/wechat.jpg"> <img src="imgs/wechat.jpg"> <img src="imgs/wechat.jpg"> <img src="imgs/wechat.jpg"> </body>
when I use html-loader@1.1.0 ,the result is
<body> <img src=/static/img/wechat.jpg> <img src=undefined> <img src=undefined> <img src=undefined> <img src=undefined> </body>
how reslove this problem ,should I use the previous version of html-loader?
Nice! it solve the question.
config in webpack.js
next code is I want to handle
when I use html-loader@1.1.0 ,the result is
how reslove this problem ,should I use the previous version of html-loader?