Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Rewrite Based on Manifest File #8

Closed
mutewinter opened this issue Apr 30, 2014 · 4 comments
Closed

Rewrite Based on Manifest File #8

mutewinter opened this issue Apr 30, 2014 · 4 comments
Labels

Comments

@mutewinter
Copy link
Owner

Renaming and replacing occurrences of DIGEST ad-hoc was a bad approach. Instead, we should generate a manifest file a la Rails and then do the rename / replacements based on its contents. We could optionally leave the manifest file around as an artifact that allows

Examples in the wild:

@jsilvestre
Copy link

If I understand correctly, that would be everyone's job to get the digest and append it in the index.html file? That sounds good to me because reading a JSON before rendering my Jade template is easy and cleaner than what I currently do (see #13) :)

Also as a suggestion (that the rewrite would allow): appending the digest to the file URL, not the file name (to ease versioning). Instead of having:

<script type="text/javascript" src="assets/myscript-2a4z2r.js"></script>

We would have:

<script type="text/javascript" src="assets/myscript.js?2a4z2r"></script>

I'm not sure this would work out of the box with all HTTP server but it works with ExpressJS and I bet this is rather common (and configurable if it's not the default behavior).

If the plugin generates a manifest with a list of "file => digest" I think it's easily doable anyway. Also, if you plan on keeping the "append" feature within the plugin, it could have two appending modes: append to file or append to URL.

Cheers and thanks again for your work!

@mutewinter
Copy link
Owner Author

Love the idea @jsilvestre. I opened #14 to make sure I don't lose track of it.

@mutewinter
Copy link
Owner Author

Closed by #24

@solisoft
Copy link

solisoft commented May 9, 2017

How does it works? How can I set the digest as parameter ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants