clubstudio / craft-asset-rev

A Craft CMS plugin to help with cache busting
MIT License
109 stars 7 forks source link

Example Manifest File #20

Closed kmgdevelopment closed 5 years ago

kmgdevelopment commented 5 years ago

Can you provide an example of what a basic manifest file should look like? I'm a little fuzzy on how that's supposed to work.

scottwakefield commented 5 years ago

Hi @kgrote,

Sure, an example manifest file could look like this:

{
    "css/main.css": "css/main.a9961d38.css",
    "js/main.js": "js/main.786087f5.js"
}

With css/main.css being the file path you would pass to rev() and css/main.a9961d38.css being the actual name of the file that was created during your build process, which will be output in your template.

I hope that helps!

kmgdevelopment commented 5 years ago

Oh, I see. So this plugin doesn't actually do the revving, it just updates the URL on the template to whatever the currently-revved file is.

scottwakefield commented 5 years ago

Correct! You could use something like https://github.com/sindresorhus/gulp-rev to generate your manifest.

danleecreates commented 5 years ago

Can we make this gulp-rev requirement clearer in the documentation? Been puzzling my brain for the last hour :)

scottwakefield commented 5 years ago

Hi @nearkingdom,

gulp-rev isn't technically a requirement for the plugin to work, as you can still use other cache-bust strategies (e.g. query string) without it, but I see where you are coming from 😄

Leave it with me and I'll get the readme updated so that it's more helpful 👍