Skip to content

Support to escape a directory for mapped version#12

Open
mokesmokes wants to merge 1 commit intoserby:masterfrom
mokesmokes:master
Open

Support to escape a directory for mapped version#12
mokesmokes wants to merge 1 commit intoserby:masterfrom
mokesmokes:master

Conversation

@mokesmokes
Copy link

You can now do versionator.createMapped(staticFileMap, 'myEscapedDirectory');, where the escaped directory will not be reverse-mapped with the hash. This is mostly required to serve CSS files that use resources with relative paths. An example would be select2.css. So I can put select2.css and select2.png in directory /css/myEscapedDirectory/select2-3.4.1/ and use link(rel='stylesheet', href='/css/myEscapedDirectory/select2-3.4.1/select2.css), and maintain versioning elsewhere.
The implementation looks for the escaped string in req.url, so you can have multiple escaped directories in your file structure (e.g. in both css and javascript directories).

@serby
Copy link
Owner

serby commented Nov 12, 2013

Can you provide some tests for this feature.

@mokesmokes
Copy link
Author

I don't think I'll have time to do this in the near future, but I can assure you I have been using this for a few months without a hitch. My production use case is exactly as specified above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants