I've been trying to learn angular. I have a test project that I setup following this tutorial:
http://shmck.com/webpack-angular-part-1/
I've been trying to augment it to use the html-loader to parse my html files and replace the src on my img tags with a require after compile. No luck. I can get the scss loader to change the context of the image to it. I can also require the image in the controller for my view. But if I just leave the img tag's src attribute alone with a relative url it does nothing.
Here's my loaders in webpack.config:
loaders:
[
{
test: /\.scss$/,
loader: 'style!css!sass'
},
{
test: /\.js$/,
loader: 'ng-annotate!babel!jshint',
exclude: /node_modules|bower_components/
},
{
test: /\.html$/,
loader: "html-loader"
},
{
test: /\.json/,
loader: 'json'
},
//not sure if this is still needed
{
test: /\.jpe?g$|\.gif$|\.png$/i, loader: "url-loader"
}
]
And here's my lowly html img tag:
<img src="./darthvader.jpg">
Trying to refactor an existing site that has tons of inline img tags and using this as a test.