{"action":"created","issue":{"url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/3","labels_url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/3/comments","events_url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/3/events","html_url":"https://github.com/bholloway/resolve-url-loader/issues/3","id":106424209,"number":3,"title":"Doesn't work with file path format of sass-loader","user":{"login":"shanear","id":1596259,"avatar_url":"https://avatars.githubusercontent.com/u/1596259?v=3","gravatar_id":"","url":"https://api.github.com/users/shanear","html_url":"https://github.com/shanear","followers_url":"https://api.github.com/users/shanear/followers","following_url":"https://api.github.com/users/shanear/following{/other_user}","gists_url":"https://api.github.com/users/shanear/gists{/gist_id}","starred_url":"https://api.github.com/users/shanear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanear/subscriptions","organizations_url":"https://api.github.com/users/shanear/orgs","repos_url":"https://api.github.com/users/shanear/repos","events_url":"https://api.github.com/users/shanear/events{/privacy}","received_events_url":"https://api.github.com/users/shanear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-14T20:45:32Z","updated_at":"2015-09-15T00:09:35Z","closed_at":null,"body":"The sass-loader seems to format the  source map file paths `sources` as absolute file paths without preceding slashes. The resolve-url-loader expects all absolute file paths to have a preceeding slash. This is causing all generated URLs to be bad.\r\n\r\nIs anyone else experiencing this?\r\n\r\nExample:\r\n\r\nexample file path in the sources:\r\n`this/is/an/absolute/path.scss`\r\n\r\nexample source file path generated:\r\n`/base/path/of/the/project/this/is/an/absolute/path.scss`"},"comment":{"url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/comments/140237775","html_url":"https://github.com/bholloway/resolve-url-loader/issues/3#issuecomment-140237775","issue_url":"https://api.github.com/repos/bholloway/resolve-url-loader/issues/3","id":140237775,"user":{"login":"bholloway","id":6868309,"avatar_url":"https://avatars.githubusercontent.com/u/6868309?v=3","gravatar_id":"","url":"https://api.github.com/users/bholloway","html_url":"https://github.com/bholloway","followers_url":"https://api.github.com/users/bholloway/followers","following_url":"https://api.github.com/users/bholloway/following{/other_user}","gists_url":"https://api.github.com/users/bholloway/gists{/gist_id}","starred_url":"https://api.github.com/users/bholloway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bholloway/subscriptions","organizations_url":"https://api.github.com/users/bholloway/orgs","repos_url":"https://api.github.com/users/bholloway/repos","events_url":"https://api.github.com/users/bholloway/events{/privacy}","received_events_url":"https://api.github.com/users/bholloway/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T00:09:34Z","updated_at":"2015-09-15T00:09:34Z","body":"@shanear Ok I have a similar setup.\r\n\r\nMy source-map `sources` are relative to the `js` from which I `require()` the `.scss` - I presume this is the SASS root. I'm not sure why yours are absolute, but we need to be robust for either case.\r\n\r\nThis code in question reused from SASS outside webpack and inherited a coupe of fixes that may not be required:\r\n\r\n* Relative paths sometimes have a leading slash.\r\n* Windows can duplicate back-slashes (multiple escaping).\r\n\r\nI will retain those fixes as defensive programming, at least until I can comprehensively discount them. The following should be more robust for all cases:\r\n\r\n```\r\n  function absolutePath(value, i, array) {\r\n    var location = value\r\n      .replace(/\\b[\\\\\\/]+\\b/g, path.sep) // remove duplicate slashes (windows)\r\n      .replace(/^[\\\\\\/]\\./, '.');        // remove erroneous leading slash on relative paths\r\n    array[i] = path.resolve(filePath, location);\r\n  }\r\n```\r\n\r\nI've just noticed some bigger problems with source maps. If you can give me a couple of hours I should have a branch today with some comprehensive fixes that you can try."}}