Troubles using an svg sprite #6367
-
I am trying to get a svg sprite working with parcel 2.0.0-beta.3.1.
also tried to add both xmlns with no luck
The svg sprite gets into the dist folder: symbol-defs.8c1d7adb.svg but the html gets transformed without the #icon-laptop
so it seems like the #icon-laptop gets removed |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I’m new to parcel so I can’t be of too much help but have you tried changing the path to a full URI (including http at the beginning as if you were using a CDN for the image) as a work-around? I had to use a CDN for jQuery because parcel doesn’t bundle it correctly and the global $ object never gets defined. The build script should ignore full URLs so you could do that as a means of getting around the bad transform. For me it’s fine as a permanent solution since using a CDN for a library script is reasonable anyway; I don’t know if it makes sense for SVG assets. |
Beta Was this translation helpful? Give feedback.
-
attention: If you want to use env variables in your posthtml.config.js: so my whole file is now:
|
Beta Was this translation helpful? Give feedback.
I’m new to parcel so I can’t be of too much help but have you tried changing the path to a full URI (including http at the beginning as if you were using a CDN for the image) as a work-around?
I had to use a CDN for jQuery because parcel doesn’t bundle it correctly and the global $ object never gets defined. The build script should ignore full URLs so you could do that as a means of getting around the bad transform.
For me it’s fine as a permanent solution since using a CDN for a library script is reasonable anyway; I don’t know if it makes sense for SVG assets.