{"action":"created","issue":{"url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/109","repository_url":"https://api.github.com/repos/webpack-contrib/url-loader","labels_url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/109/comments","events_url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/109/events","html_url":"https://github.com/webpack-contrib/url-loader/issues/109","id":295018146,"number":109,"title":"Different paths per loader","user":{"login":"faustbrian","id":22145591,"avatar_url":"https://avatars3.githubusercontent.com/u/22145591?v=4","gravatar_id":"","url":"https://api.github.com/users/faustbrian","html_url":"https://github.com/faustbrian","followers_url":"https://api.github.com/users/faustbrian/followers","following_url":"https://api.github.com/users/faustbrian/following{/other_user}","gists_url":"https://api.github.com/users/faustbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/faustbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faustbrian/subscriptions","organizations_url":"https://api.github.com/users/faustbrian/orgs","repos_url":"https://api.github.com/users/faustbrian/repos","events_url":"https://api.github.com/users/faustbrian/events{/privacy}","received_events_url":"https://api.github.com/users/faustbrian/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-07T06:09:14Z","updated_at":"2018-02-07T12:15:55Z","closed_at":"2018-02-07T08:13:48Z","author_association":"NONE","body":"I have a `base` html tag in my document and reference files via `src=\"assets/bla.css\"` instead of `src=\"/assets/bla.css\"` **(note the leading /)**.\r\n\r\nThe issue that causes is that the url-loader references fonts via `assets/fonts/bla.otf` instead of `/assets/fonts/bla.otf` inside a CSS file which then causes the browser to try to load the font from `/assets/css/assets/fonts/bla.otf`.\r\n\r\nIs there some way to tell the url loader how to reference the file inside the CSS file so that it would use a leading **/**?\r\n\r\n```js\r\noutput: {\r\n  publicPath: ''\r\n},\r\n\r\n{\r\n  test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\r\n  loader: 'url-loader',\r\n  options: {\r\n    limit: 10000,\r\n    name: utils.assetsPath('fonts/[name].[hash:7].[ext]')\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/comments/363751240","html_url":"https://github.com/webpack-contrib/url-loader/issues/109#issuecomment-363751240","issue_url":"https://api.github.com/repos/webpack-contrib/url-loader/issues/109","id":363751240,"user":{"login":"michael-ciniawsky","id":5419992,"avatar_url":"https://avatars0.githubusercontent.com/u/5419992?v=4","gravatar_id":"","url":"https://api.github.com/users/michael-ciniawsky","html_url":"https://github.com/michael-ciniawsky","followers_url":"https://api.github.com/users/michael-ciniawsky/followers","following_url":"https://api.github.com/users/michael-ciniawsky/following{/other_user}","gists_url":"https://api.github.com/users/michael-ciniawsky/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-ciniawsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-ciniawsky/subscriptions","organizations_url":"https://api.github.com/users/michael-ciniawsky/orgs","repos_url":"https://api.github.com/users/michael-ciniawsky/repos","events_url":"https://api.github.com/users/michael-ciniawsky/events{/privacy}","received_events_url":"https://api.github.com/users/michael-ciniawsky/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T12:15:55Z","updated_at":"2018-02-07T12:15:55Z","author_association":"MEMBER","body":"Thats what the `file-loader` && `css-loader` should do already. `webpack` picks up the relative path and replaces it with the `output` path of the asset in the CSS"}}
{"actor":{"display_login":"michael-ciniawsky"}}