@jebka/next-svg-sprite-loader
v1.1.7
Published
Load SVGs into webpack and split them into sprites at will
Downloads
10
Maintainers
Readme
@jebka/next-svg-sprite-loader
Integrate @jebka/webpack-svg-sprite-loader into Next.js configuration
This is just a convenience package to make @jebka/webpack-svg-sprite-loader work with less configuration. All the steps can be done manually. See the docs of @jebka/webpack-svg-sprite-loader.
Installation
npm install --save-dev @jebka/next-svg-sprite-loader
Configuration
The plugin amends the webpack config for Next.js, so it needs to be called inside the webpack config hook function.
The convenience function mutates the config and also returns the same instance.
import { configSvgSprites } from "@jebka/next-svg-sprite-loader";
export default {
webpack(config) {
return configSvgSprites(config, {
// SvgSpritePluginOptions
});
},
};
Manual Next.js configuration
See the code, it has inline commentary.