{"action":"created","issue":{"url":"https://api.github.com/repos/taptapship/wiredep/issues/241","repository_url":"https://api.github.com/repos/taptapship/wiredep","labels_url":"https://api.github.com/repos/taptapship/wiredep/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/taptapship/wiredep/issues/241/comments","events_url":"https://api.github.com/repos/taptapship/wiredep/issues/241/events","html_url":"https://github.com/taptapship/wiredep/issues/241","id":154442549,"number":241,"title":"fileTypes > replace don't working","user":{"login":"Tibicenas","id":6190477,"avatar_url":"https://avatars.githubusercontent.com/u/6190477?v=3","gravatar_id":"","url":"https://api.github.com/users/Tibicenas","html_url":"https://github.com/Tibicenas","followers_url":"https://api.github.com/users/Tibicenas/followers","following_url":"https://api.github.com/users/Tibicenas/following{/other_user}","gists_url":"https://api.github.com/users/Tibicenas/gists{/gist_id}","starred_url":"https://api.github.com/users/Tibicenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tibicenas/subscriptions","organizations_url":"https://api.github.com/users/Tibicenas/orgs","repos_url":"https://api.github.com/users/Tibicenas/repos","events_url":"https://api.github.com/users/Tibicenas/events{/privacy}","received_events_url":"https://api.github.com/users/Tibicenas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-12T09:55:23Z","updated_at":"2016-05-12T18:34:03Z","closed_at":null,"body":" Ok the point is[ this issue about take .min version of the css or files pointed within bower.json](https://github.com/taptapship/wiredep/issues/52)\r\n\r\nWe cannot ask Wiredep to search inside each package to take that specific file, but WE CAN modify the output injected into our HTML ( this is dangerous in case a package hasn't .min version, but thats not question)\r\n\r\nSo what i'm trying to do is something like this:\r\n\r\n```javascript\r\n var wiredepOptions = function() {\r\n    var options = {\r\n      ignorePath : '../..',\r\n      bowerJson  : require('./bower.json'),\r\n      directory  : './bower_components/',\r\n      fileTypes  : {\r\n        html: {\r\n          block: /(([ \\t]*)<!--\\s*bower:*(\\S*)\\s*-->)(\\n|\\r|.)*?(<!--\\s*endbower\\s*-->)/gi,\r\n          detect: {\r\n            js: /<script.*src=['\"]([^'\"]+)/gi,\r\n            css: /<link.*href=['\"]([^'\"]+)/gi\r\n          },\r\n          replace: {\r\n            js: function(filePath) {\r\n              var minFilePath = filePath.replace('.js', '.min.js');\r\n              return '<script src=\"{{minFilePath}}\"></script>';\r\n            }\r\n          }\r\n        }\r\n      }\r\n    };\r\n    return options;\r\n  };\r\n```\r\n\r\nBut this key fileTypes > >  replace:  looks do nothing !\r\n"},"comment":{"url":"https://api.github.com/repos/taptapship/wiredep/issues/comments/218846274","html_url":"https://github.com/taptapship/wiredep/issues/241#issuecomment-218846274","issue_url":"https://api.github.com/repos/taptapship/wiredep/issues/241","id":218846274,"user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T18:34:03Z","updated_at":"2016-05-12T18:34:03Z","body":"Works for me: https://gist.github.com/stephenplusplus/05649c7946fac9818cab6a805ad45443\r\n\r\n> We cannot ask Wiredep to search inside each package to take that specific file,\r\n\r\nI added in a check for a min file. If it's found, it's used. If not, it'll just use the original file."}}