Webpack 2+: How to apply different loaders for files with same extension?
问题 Here's my use-case: Most svgs should be inlined. So I setup a rule like this: {test: /\.svg$/, use: "svg-inline-loader"}, In some instances I just want the url of an svg rather than inlining it. In webpack 1.x I required them like this: require('path/to/file.svg?external') . Here's the corresponding rule: {test: /\.svg\?external$/, use: "file-loader!image-webpack-loader"}, It seems like webpack 2 does not include the ? part anymore when test ing for a rule since only the first rule is being