Comments (7)
Just released version 2.2.0. You now have the iconName
option. For your case you can change it to icon-[name]
and icon names will no longer be hashed. Hope it works!
from external-svg-sprite-loader.
@michaelpumo this loader was built with JS in mind, so I never thought about this use case. I could provide an option to change the icons names, that would actually make sense. But if you don't use an hash then you need to make sure your SVG files have unique names. What do you think of that?
In any case, I think you could use the html-loader and / or the pug-loader to achieve what you are trying to do. I haven't tested it so maybe I am wrong.
from external-svg-sprite-loader.
I think this would be a great addition!
Simply to have an option that only takes the filenames as the ID's I think would be fine because the filenames themselves have to be unique when in the same folder anyway.
This is what I currently do using a Gulp task and never have issues here.
Not looked into using those loaders as I'm still finding my way with webpack. Thanks for the heads up.
Is this a realistically feesible feature? It would make building static HTML sites so much easier.
Thanks
from external-svg-sprite-loader.
I agree with the option and I created the PR #17 for it just now. However, I think you should be using some additional loader (as I mentioned above) because what you are trying to do isn't really the webpack way :p
from external-svg-sprite-loader.
Thank you very much for this. I haven't tried it yet, but I appreciate your hard work and will let you know if there's any problems! 🙏🏼
from external-svg-sprite-loader.
@bensampaio When I run yarn
on my package.json
that specifies version 2.2.0
- what I actually seem to get is version 2.1.2
.
I'm not sure if this is a separate issue. The code for your loader in my node_modules does not reflect the code you have on your GitHub repository. In the package.json
, it tells me version 2.1.2
.
Because of this, the suggested solution / fix you did does not work, because I don't have these new updates. Not sure what's happening here?
Funny enough, even trying to pull from the repo on GitHub directly does not seem to get this latest version you have:
"external-svg-sprite-loader": "https://github.com/karify/external-svg-sprite-loader.git"
Perhaps I am missing something very obvious here?
Thanks!
UPDATE: Running npm
instead of yarn
seems to work - which strikes me as very odd. Any clues on this?
UPDATE 2: So, after deleting my yarn lockfile and running this again, it seems to work. Apologies for all of this, as it doesn't seem to be your issue after all, but I shall leave this here just in case.
from external-svg-sprite-loader.
@michaelpumo yarn saves the last installed version on the lock file and will always install that one everytime you run yarn
. To install the most recent version you need to run yarn upgrade external-svg-sprite-loader
. Or to update all your dependencies just run yarn upgrade
. This is one of the reasons why yarn
was invented :)
from external-svg-sprite-loader.
Related Issues (20)
- Clearer errors when trying to use the latest version with Webpack 4
- Duplicated IDs in icon sprite
- angular13 not generate sprite file
- It doesn't work with webpack 5 cache=filesystem
- SVGO Options HOT 4
- "TypeError: loaders is not iterable" after upgrade to v4 HOT 8
- Odd behavior when generating a manifest file HOT 8
- consistency with others loaders in manifest.json HOT 4
- Error when defining Rule.use as a function HOT 2
- Using `webpack-chain` breaks default options HOT 1
- It doesn't generate svg sprite HOT 17
- The module removes "fill" attribute when converting to symbol HOT 2
- Alternative (simpler) way to address the images inside the sprite (no math) HOT 1
- deprecation warning for chunk.files in webpack 5 HOT 1
- The sprite status is blocked: origin (webpack --mode production) HOT 23
- Can't run in storybook
- Deprecation warning for Chunk.modulesIterable
- Breaks with [email protected] HOT 3
- SvgStorePlugin fails if there are any other unrelated errors in the build HOT 1
- Support and compatibility with Webpack 4 regarding mini-css-extract-plugin HOT 6
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 external-svg-sprite-loader.