grunt-filerev-assets
grunt-filerev-assets copied to clipboard
provide a way to manipulate the paths
I'm using this to map templates for use in client side angular projects. Unfortunately on windows local development, grunt-filerev will create paths with the incorrect slash \\
instead of /
.
While it's great that you account for a change in the root of the path, perhaps we could use a callback or a regular expression to modify it instead?
something like :
filerev_assets:
dist:
options:
dest: "templates/map.json"
cwd: "<%= paths.dist %>"
prefix: ""
prettyPrint: true
patterns: [
s/\\\\/\//
s/dist\///
]
and/or
filerev_assets:
dist:
options:
dest: "templates/map.json"
cwd: "<%= paths.dist %>"
prefix: ""
prettyPrint: true
patterns: (value, key) ->
if !value.indexOf "html" or !key.indexOf "html"
return
value = value.replace '\\', '/'
value = value.replace 'dist/', ''
excuse me if my regex sucks.
Sure - feel free to submit a pull request with tests and I'd be happy to merge this idea.
This PR solves the problem #8