Comments (4)
Can you provide an example in code?
from grunt-cache-bust.
A contrived example would be something like:
/index.html
includes/static/css/site.css
- The server is configured to route
/static/(.+)
to/static_assets/$1
- 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.
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.
Ooh, perfect, that'll do the trick!
Thanks!
from grunt-cache-bust.
Related Issues (20)
- Change in referenced file not propagating HOT 1
- Error in replaceInFile HOT 2
- Upgrading from 1.4.1 to 1.5.0 causes crash on cache bust
- Is this project dead ? HOT 7
- Cache bust generates triple query param HOT 1
- URLs with fragments are not replaced in files
- Custom Algorithm To Generate One Hash For All Files HOT 1
- After Upgrading from 1.4.1 to 1.6.0 the tags in my layout file gets no more busted HOT 3
- Nested references not updating
- Help configuring to replace references. HOT 3
- Allow to configurate optional domain for absolute paths HOT 4
- "0 files busted" although it did work
- When runngin Grunt : SyntaxError: Unexpected token ... HOT 1
- References in Subfolders not getting updated HOT 4
- Support for Grunt files[].dest option
- Merge option for manifest
- Change file name in requirejs main file(Config)
- Hash values not updating HOT 2
- Cache Bust generating converted files with '\' instead of '/'
- Inherited Task - double hashing the assets
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 grunt-cache-bust.