Giter VIP home page Giter VIP logo

Comments (4)

benhoIIand avatar benhoIIand commented on June 10, 2024

Can you provide an example in code?

from grunt-cache-bust.

command-tab avatar command-tab commented on June 10, 2024

A contrived example would be something like:

  1. /index.html includes /static/css/site.css
  2. The server is configured to route /static/(.+) to /static_assets/$1
  3. When grunt-cache-bust goes to process /static/css/site.css, it doesn't find it at its real location of /static_assets/css/site.css.

My on-disk vs. web-path hierarchy is more complicated than that for various reasons, but the logic is identical. So, it would be handy to be able to add a filters object that would take #grunt-cache-bust-suffixed paths and apply the given function(s) to them, providing the opportunity to modify paths so grunt-cache-bust can find files where they're really located.

from grunt-cache-bust.

benhoIIand avatar benhoIIand commented on June 10, 2024

Thanks for the extra details - hopefully this will be a good solution.

There is a replaceTerms option, which is hidden from the documentation, which replaces given terms in the filename. This is done before generating the hash and busting the file.

It was a feature built for a single project I was working on, hence it not being in the documentation. Here's an example of how to use it.

from grunt-cache-bust.

command-tab avatar command-tab commented on June 10, 2024

Ooh, perfect, that'll do the trick!

Thanks!

from grunt-cache-bust.

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.