{
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: path.resolve(__dirname, 'src/icons/'),
options: {
extract: true,
spriteFilename: 'icons/icons.svg',
}
}
function requireAll(r) {
r.keys().forEach(r);
}
requireAll(require.context('./icons', true, /\.svg$/));
{
test: /\.(png|jpg|svg|webp|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'images/'
}
}
]
}