Skip to content

Introduce hashOnly option that skips writing the file and only outputs map of replacements#34

Open
rasmusvhansen wants to merge 4 commits intokeithamus:masterfrom
rasmusvhansen:hashonly
Open

Introduce hashOnly option that skips writing the file and only outputs map of replacements#34
rasmusvhansen wants to merge 4 commits intokeithamus:masterfrom
rasmusvhansen:hashonly

Conversation

@rasmusvhansen
Copy link

In a project I am working on, we want to use query parameter based cache busting, and for that purpose we do not need any files to be written. I have introduced a -h parameter that can be used as

hashmark -l 8 -h 'file.js?{hash}'

@keithamus
Copy link
Owner

Thanks @rasmusvhansen this looks cool! Do you mind also adding a test for this usecase?

@rasmusvhansen
Copy link
Author

I will try. The tests don't seem to work on Windows, however as they use Unix specific commands. I will see if I can get it to run on a virtual machine.

@edwinveldhuizen
Copy link

edwinveldhuizen commented Jul 26, 2018

It would cool that if in combination with replaceinfiles we could instead of
foo.js -> foo-{hash}.js -> replaced in files to foo-{hash}.js
do something like:
foo.js -> replaced in files to foo.js?{hash}

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