const svgList = require.context('../assets/svg', false, /\.svg$/);
const requireSvg = requireContext => requireContext.keys().map(requireContext);
requireSvg(svgList);
{
chainWebpack: config => {
config.module
.rule('svg')
.exclude.add(resolve('src/assets/svg'))
.end();
config.module
.rule('remixIcon')
.test(/\.svg$/)
.include.add(resolve('src/assets/svg'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({ symbolId: 'svg-icon-[name]' })
.end();
};
}
<svg-icon :icon-class="'home'"></svg-icon>