I'm currently working on cache-busting my SVGs and other files like translation JSON.
The issue I'm facing is that webpack does not seem to recognize imported svgs in the following format:
<md-icon md-svg-src="assets/icons/ic-edit.svg"></md-icon>
I am looking for a way to hash the file names so using CopyWebpackPlugin to copy and hash assets won't work, as it would require manual updates within the markup.
{
test: /\.svg$/,
loader: 'file-loader',
options: {
name(file) {
// The console doesn't log anything as it's not detecting urls within Angular templates
console.log(file);
return '[name]-[hash].[ext]'
}
}
}
What are my options for handling SVG files within my application? It seems like a significant task to refactor all of the SVGs from template usage to importing them in JavaScript and utilizing them inline. Is there another solution available or is this the best approach?