{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/less-loader/issues/8","labels_url":"https://api.github.com/repos/webpack/less-loader/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/webpack/less-loader/issues/8/comments","events_url":"https://api.github.com/repos/webpack/less-loader/issues/8/events","html_url":"https://github.com/webpack/less-loader/issues/8","id":31278448,"number":8,"title":"less-loader should rewrite url(...) in less files","user":{"login":"andreypopp","id":30594,"avatar_url":"https://avatars.githubusercontent.com/u/30594?v=3","gravatar_id":"","url":"https://api.github.com/users/andreypopp","html_url":"https://github.com/andreypopp","followers_url":"https://api.github.com/users/andreypopp/followers","following_url":"https://api.github.com/users/andreypopp/following{/other_user}","gists_url":"https://api.github.com/users/andreypopp/gists{/gist_id}","starred_url":"https://api.github.com/users/andreypopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreypopp/subscriptions","organizations_url":"https://api.github.com/users/andreypopp/orgs","repos_url":"https://api.github.com/users/andreypopp/repos","events_url":"https://api.github.com/users/andreypopp/events{/privacy}","received_events_url":"https://api.github.com/users/andreypopp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2014-04-10T20:34:11Z","updated_at":"2015-05-20T11:02:04Z","closed_at":"2014-04-11T19:17:32Z","body":"Right now when trying to load bootstrap it fails because it tries to resolve `url(...)` extracted from already rendered CSS, of course `url(...)` are incorrect because they are relative to original filenames.\r\n\r\nA simple fix:\r\n```\r\nif (/url\\(/.exec(data)) {\r\n  data = data.replace(/url\\(([^\\)]+)\\)/g, function(_, url) {\r\n    url = url.replace(/^(\\\\\"|\"|'|\\\\')/, '').replace(/(\\\\\"|\"|'|\\\\')$/, '');\r\n    url = 'url(' + path.dirname(filename) + '/' + url + ')';\r\n    return url;\r\n  });\r\n}\r\n```\r\nseems to work, but I've found that we can apply another [patch](https://github.com/ForbesLindesay/less-fixed/blob/master/lib/url-fixer.js) to less compiler for a \"cleaner\" way to do that."},"comment":{"url":"https://api.github.com/repos/webpack/less-loader/issues/comments/103843373","html_url":"https://github.com/webpack/less-loader/issues/8#issuecomment-103843373","issue_url":"https://api.github.com/repos/webpack/less-loader/issues/8","id":103843373,"user":{"login":"luisrudge","id":941075,"avatar_url":"https://avatars.githubusercontent.com/u/941075?v=3","gravatar_id":"","url":"https://api.github.com/users/luisrudge","html_url":"https://github.com/luisrudge","followers_url":"https://api.github.com/users/luisrudge/followers","following_url":"https://api.github.com/users/luisrudge/following{/other_user}","gists_url":"https://api.github.com/users/luisrudge/gists{/gist_id}","starred_url":"https://api.github.com/users/luisrudge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisrudge/subscriptions","organizations_url":"https://api.github.com/users/luisrudge/orgs","repos_url":"https://api.github.com/users/luisrudge/repos","events_url":"https://api.github.com/users/luisrudge/events{/privacy}","received_events_url":"https://api.github.com/users/luisrudge/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T11:02:04Z","updated_at":"2015-05-20T11:02:04Z","body":"Yeah. Sorry for the typo"}}