I need to match a file extension for webpack rules using regex. I want to make two separate rules for targeting svg files: *.svg
and *.icon.svg
.
These rules must be mutually exclusive. It's easy to caputure *.icon.svg scenario by testing for /\.icon.svg$/
. But what should be the expression to capture all .svg
extensions, excluding the files that end with .icon.svg
?
Rule example for the .icon.svg
config.module.rules.push({
test: /\.svg$/,
loader: 'vue-svg-loader'
})