Giter Site home page Giter Site logo

Comments (7)

bensampaio avatar bensampaio commented on July 29, 2024 1

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.

bensampaio avatar bensampaio commented on July 29, 2024

@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.

michaelpumo avatar michaelpumo commented on July 29, 2024

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.

bensampaio avatar bensampaio commented on July 29, 2024

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.

michaelpumo avatar michaelpumo commented on July 29, 2024

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.

michaelpumo avatar michaelpumo commented on July 29, 2024

@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.

bensampaio avatar bensampaio commented on July 29, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.