Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function svgSpriteRuntimeGenerator(params) {
const { symbol, config, context, loaderContext } = params;
const {
extract,
esModule,
spriteModule,
symbolModule,
runtimeCompat,
publicPath,
} = config;
let runtime;
let symbolId = symbol.id.replace('--sprite', '');
if (extract) {
const spritePlaceholder = generateSpritePlaceholder(
symbol.request.file
);
const publicPath = stringify(publicPath) || '__webpack_public_path__';
const viewBoxParts = symbol.viewBox.split(' ');
const width = parseInt(viewBoxParts[2], 10);
const height = parseInt(viewBoxParts[3], 10);
const data = `{
id: ${stringify(symbolId)},
viewBox: ${stringify(symbol.viewBox)},
url: ${publicPath} + ${stringify(spritePlaceholder)},
width: ${width},
height: ${height},
toString: function () {
return this.url;
module.exports = function runtimeGenerator(params) {
const { symbol, config, context, loaderContext } = params;
const {
extract,
esModule,
spriteModule,
symbolModule,
runtimeCompat,
publicPath,
} = config;
let runtime;
let symbolId = symbol.id.replace('--sprite-notrc', '');
if (extract) {
const spritePlaceholder = generateSpritePlaceholder(
symbol.request.file
);
const publicPath = stringify(publicPath) || '__webpack_public_path__';
const viewBoxParts = symbol.viewBox.split(' ');
const width = parseInt(viewBoxParts[2], 10);
const height = parseInt(viewBoxParts[3], 10);
const data = `{
id: ${stringify(symbolId)},
viewBox: ${stringify(symbol.viewBox)},
url: ${publicPath} + ${stringify(spritePlaceholder)},
width: ${width},
height: ${height},
toString: function () {
return this.url;
module.exports = function runtimeGenerator({ symbol, config, context, loaderContext }) {
const { extract, esModule, spriteModule, symbolModule, runtimeCompat } = config;
let runtime;
let symbolId = symbol.id.replace('--sprite', '');
if (extract) {
const spritePlaceholder = generateSpritePlaceholder(symbol.request.file);
const publicPath = loaderContext._compiler.options.output.publicPath;
const viewBoxParts = symbol.viewBox.split(' ');
const width = parseInt(viewBoxParts[2], 10);
const height = parseInt(viewBoxParts[3], 10);
const data = `{
id: ${stringify(symbolId)},
viewBox: ${stringify(symbol.viewBox)},
url: ${publicPath} + ${stringify(spritePlaceholder)},
width: ${width},
height: ${height}
}`;
runtime = generateExport(data, esModule);
} else {