{"action":"created","issue":{"url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/17","labels_url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/17/comments","events_url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/17/events","html_url":"https://github.com/shonny-ua/gulp-rev-collector/issues/17","id":104764624,"number":17,"title":"dirReplacements not working properly","user":{"login":"dciccale","id":539546,"avatar_url":"https://avatars.githubusercontent.com/u/539546?v=3","gravatar_id":"","url":"https://api.github.com/users/dciccale","html_url":"https://github.com/dciccale","followers_url":"https://api.github.com/users/dciccale/followers","following_url":"https://api.github.com/users/dciccale/following{/other_user}","gists_url":"https://api.github.com/users/dciccale/gists{/gist_id}","starred_url":"https://api.github.com/users/dciccale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dciccale/subscriptions","organizations_url":"https://api.github.com/users/dciccale/orgs","repos_url":"https://api.github.com/users/dciccale/repos","events_url":"https://api.github.com/users/dciccale/events{/privacy}","received_events_url":"https://api.github.com/users/dciccale/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-03T19:26:59Z","updated_at":"2015-09-03T19:37:18Z","closed_at":null,"body":"`rev-manifest.json`\r\n```json\r\n{\r\n  \"assets/images/avatar.png\": \"assets/images/avatar-616d026e5f.png\"\r\n}\r\n```\r\n\r\n`gulpfile.js`\r\n```js\r\ngulp.task('rev-img', ['imagemin'], function () {\r\n  return gulp.src(['rev-manifest.json', 'dist/server/views/index.jade'])\r\n    .pipe($.revCollector({\r\n      replaceReved: true,\r\n      dirReplacements: {\r\n        'assets/images/': 'http://my.cdn.net/'\r\n      }\r\n    }))\r\n    .pipe(gulp.dest('dist/server/views'));\r\n});\r\n```\r\n\r\n`dist/server/views/index.jade`\r\n```jade\r\np\r\n  img.img-responsive(src=\"/assets/images/avatar.png\")\r\n```\r\n\r\nit doesn't get replaced.\r\n\r\ndesired output:\r\n\r\n```jade\r\np\r\n  img.img-responsive(src=\"http://my.cdn.net/avatar-616d026e5f.png\")\r\n```\r\n\r\ni am not sure i am using `dirReplacements` correctly.\r\n\r\nwhat i don't see clear is why you are concatenating the replacement string with the pattern at line 93 https://github.com/shonny-ua/gulp-rev-collector/blob/master/index.js#L93\r\n\r\nthat makes the `regexp` to be `/assets\\/images\\/assets\\/images\\/avatar\\.png/g`"},"comment":{"url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/comments/137552881","html_url":"https://github.com/shonny-ua/gulp-rev-collector/issues/17#issuecomment-137552881","issue_url":"https://api.github.com/repos/shonny-ua/gulp-rev-collector/issues/17","id":137552881,"user":{"login":"dciccale","id":539546,"avatar_url":"https://avatars.githubusercontent.com/u/539546?v=3","gravatar_id":"","url":"https://api.github.com/users/dciccale","html_url":"https://github.com/dciccale","followers_url":"https://api.github.com/users/dciccale/followers","following_url":"https://api.github.com/users/dciccale/following{/other_user}","gists_url":"https://api.github.com/users/dciccale/gists{/gist_id}","starred_url":"https://api.github.com/users/dciccale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dciccale/subscriptions","organizations_url":"https://api.github.com/users/dciccale/orgs","repos_url":"https://api.github.com/users/dciccale/repos","events_url":"https://api.github.com/users/dciccale/events{/privacy}","received_events_url":"https://api.github.com/users/dciccale/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T19:37:18Z","updated_at":"2015-09-03T19:37:18Z","body":"i made workaround:\r\n\r\n```js\r\n      dirReplacements: {\r\n        // 'assets/images': 'http://my.cdn.net/'\r\n        '/': function (file) {\r\n          return file.replace(/assets\\/images\\//, 'http://my.cdn.net/');\r\n        }\r\n      }\r\n```\r\n\r\nhowever would be cool just using the `dirReplacements` mappping"}}