rsbuild-svg-sprite-loader is a Rsbuild plugin to do something.
Install:
npm add rsbuild-svg-sprite-loader -D
Add plugin to your rsbuild.config.ts
:
// rsbuild.config.ts
import { pluginSvgSpriteLoader } from "rsbuild-plugin-svg-sprite-loader";
export default {
plugins: [
pluginSvgSpriteLoader({
path: join(__dirname, 'src/icons'),
symbolId: 'icon-[name]',
}),
],
};
Some description.
- path:
string
- symbolId:
string
- Example:
pluginSvgSpriteLoader({
path: join(__dirname, 'src/icons'),
symbolId: 'icon-[name]',
})
MIT.