Support to escape a directory for mapped version#12
Open
mokesmokes wants to merge 1 commit intoserby:masterfrom
Open
Support to escape a directory for mapped version#12mokesmokes wants to merge 1 commit intoserby:masterfrom
mokesmokes wants to merge 1 commit intoserby:masterfrom
Conversation
Owner
|
Can you provide some tests for this feature. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 uselink(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).