svg-sprite-loader
svg-sprite-loader copied to clipboard
spritePlaceholder function might expose server file structure in multisite environment
What is the current behavior? spritePlaceholder function exposes server file structure in a multisite environment SVG file content:
export default {
id: "sprite-01-usage",
viewBox: "0 0 34.616 34.616",
url: "/" + "C:\\wamp64\\[...]\\web\\img\\svg-sprites\\sprite-01.svg",
toString: function () {
return this.url;
}
}
What is the expected behavior? Ability to turn off the full URL info
export default {
id: "sprite-01-usage",
viewBox: "0 0 34.616 34.616",
url: "/",
toString: function () {
return this.url;
}
}
If the current behavior is a bug, please provide the steps to reproduce, at least part of webpack config with loader configuration and piece of your code.
Webpack config:
[...]
.addLoader({
test: /svg-sprites(\/|\\).*\.svg$/, // your icons directory
loader: 'svg-sprite-loader',
options: {
extract: true,
spriteFilename: './sprites/icons.svg', // this is the destination of your sprite sheet
publicPath: '/',
}
})
Content of extracted Svg file:
export default {
id: "sprite-01-usage",
viewBox: "0 0 34.616 34.616",
url: "/" + "C:\\wamp64\\[...]\\web\\img\\svg-sprites\\sprite-01.svg",
toString: function () {
return this.url;
}
}
Please tell us about your environment:
- Node.js version: 10.15.3
- webpack version: webpack-encore 0.27.0
- svg-sprite-loader version: 4.1.6
- OS type & version: Win 10.0.18363 (same happens on Linux/Apche server)
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Add a param to omit that information in the extracted file or relate to page root, not the server root.