You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.addRule({
test: /\.svg$/,
use: [{
loader: 'svg-sprite-loader',
options: {
extract: false, // Extract the sprite into its own file
}
}, 'svgo-loader'] // Optionally, you can use svgo-loader to optimize SVG files
})
base.html.twig:
<svg><usexlink:href="#delivery"></use></svg>
but nothing's happening.
One more thing, ur examples is not full, pls rewrite this examples if it's possible...
I trying to use spriteModule, as well. But I getting empty svg tag:
importBrowserSpritefrom'svg-baker-runtime/src/browser-sprite';importdomreadyfrom'domready';import'../images/svg/icons/delivery.svg';constsprite=newBrowserSprite();domready(()=>sprite.mount('#sprite-icons-custom'));exportdefaultsprite;// don't forget to export!
But if I will use
sprite.add(delivery);
I getting error:
sprite.js:71 Uncaught TypeError: s.stringify is not a function
at sprite.js:71:1
at Array.map (<anonymous>)
at BrowserSprite.stringify (sprite.js:71:1)
at BrowserSprite.render (browser-sprite.js:220:17)
at BrowserSprite.mount (browser-sprite.js:202:1)
at icons-sprite.js:9:23
code:
importBrowserSpritefrom'svg-baker-runtime/src/browser-sprite';importdomreadyfrom'domready';importdeliveryfrom'../images/svg/icons/delivery.svg';constsprite=newBrowserSprite();sprite.add(delivery);domready(()=>sprite.mount('#sprite-icons-custom'));exportdefaultsprite;// don't forget to export!
Node.js version: v20.3.0
webpack version: 5.74.0
svg-sprite-loader version: 6.0.11
OS type & version: MacOs Ventura
The text was updated successfully, but these errors were encountered:
According to doc:
Default browser runtime example
All what i need to do - add import in my app.js and write id in use tag:
app.js:
webpack.config.js:
base.html.twig:
but nothing's happening.
One more thing, ur examples is not full, pls rewrite this examples if it's possible...
I trying to use spriteModule, as well. But I getting empty svg tag:
But if I will use
I getting error:
code:
The text was updated successfully, but these errors were encountered: