Comments (8)
from svg-sprite-loader.
Unfortunately we can't have automatic universal solution.
Angular is just widespread case of <base>
usage, which is easy to automate.
from svg-sprite-loader.
Why not always use an absolute path like in the solution mentioned by @kisenka? Shouldn't that fix the <base>
problem completely?
At the moment i'm using something like this
<use xlink:href="${ window.location.href.split('#')[0] + icon }"></use>
from svg-sprite-loader.
Because absolute path changes when navigation (using history API) happened, so we have to update xlink:href
s of all existing icons, that's why we listen to custom spriteLoaderLocationUpdated
event in order to do it on time.
So actually you need both second and third point from the comment.
from svg-sprite-loader.
Thanks for the clarification :) I didn't think about the history api. More docs about the <base>
issue would be a great addition 👍
from svg-sprite-loader.
My pleasure :)
Let us know if you have any ideas on custom event API.
from svg-sprite-loader.
@davidspiess BTW, would you like to make a PR regarding #30?
from svg-sprite-loader.
@princed right now i'm quite busy, but i'll dive into it this weekend :)
from svg-sprite-loader.
Related Issues (20)
- Webpack 5 cache=filesystem HOT 2
- Performance consumption HOT 1
- del
- NPM recommending svg-sprite-loader 2.0.3 as a vulnerability fix?
- Exception emitted for every svg
- How can I add new attributes to the parent SVG?
- Is there a way to set role, focusable and other attributes to root svg sprite tag without extracting?
- Regular Expression Denial of Service in postcss (6.0.11) HOT 2
- Unable to modify spriteFilename if loader rule has resourceQuery while using SpriteLoaderPlugin HOT 1
- SvgSpriteLoader is trying to guess you are using webpack 4 or 5 HOT 1
- Node16 npm audit moderate HOT 1
- SVG created is blank HOT 1
- The plugin doesn-t see rules if config in oneOf HOT 2
- Abnormal width and height
- Dependency on loader-utils 1.1.0 is security concern, CRITICAL vulnerabilities
- Module Warning (from ./node_modules/svg-sprite-loader/lib/loader.js): svg-sprite-loader exception. Some loaders will be applied after svg-sprite-loader in extract mode
- sprite.svg load every time when change showing icon HOT 1
- svg-sprite-loader not working well with encore webpack
- Webpack deprecation warning
- Esbuild alternative HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg-sprite-loader.