What should I type in <img>
'src' attribute to make html-loader replace it with URL? Assume folder 'public' is served via webpack-dev-server, project layout looks like
- src
- index.js
- img
- dog.jpg
- cat.jpg
- public
- index.html
webpack.config.js has rules for url-loader and html-loader:
{ test: /\.(png|jpg)$/, loader: 'file-loader' },
{ test: /\.(html)$/, loader: 'html-loader'},
index.js imports images:
import './../img/cat.jpg'
import './../img/dog.jpg'
And index.html has <script>
for index.bundle.js. I expect <img src="dog.jpg">
to be processed, but this doesn't happen. Where am I wrong? Thanks.