{"action":"created","issue":{"url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/286","repository_url":"https://api.github.com/repos/webpack-contrib/file-loader","labels_url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/286/comments","events_url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/286/events","html_url":"https://github.com/webpack-contrib/file-loader/issues/286","id":340943196,"node_id":"MDU6SXNzdWUzNDA5NDMxOTY=","number":286,"title":"Problem about publicPath if not set in file-loader's options","user":{"login":"meteorlxy","id":18205362,"node_id":"MDQ6VXNlcjE4MjA1MzYy","avatar_url":"https://avatars3.githubusercontent.com/u/18205362?v=4","gravatar_id":"","url":"https://api.github.com/users/meteorlxy","html_url":"https://github.com/meteorlxy","followers_url":"https://api.github.com/users/meteorlxy/followers","following_url":"https://api.github.com/users/meteorlxy/following{/other_user}","gists_url":"https://api.github.com/users/meteorlxy/gists{/gist_id}","starred_url":"https://api.github.com/users/meteorlxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteorlxy/subscriptions","organizations_url":"https://api.github.com/users/meteorlxy/orgs","repos_url":"https://api.github.com/users/meteorlxy/repos","events_url":"https://api.github.com/users/meteorlxy/events{/privacy}","received_events_url":"https://api.github.com/users/meteorlxy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-13T09:16:49Z","updated_at":"2018-10-30T17:59:05Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  Issues are so 🔥\r\n\r\n  If you remove or skip this template, you'll make the 🐼 sad and the mighty god\r\n  of Github will appear and pile-drive the close button from a great height\r\n  while making animal noises.\r\n\r\n  👉🏽 Need support, advice, or help? Don't open an issue!\r\n  Head to StackOverflow or https://gitter.im/webpack/webpack.\r\n-->\r\n\r\n* Operating System: Windows 10 x64 Pro & Ubuntu 18.04\r\n* Node Version:  v10.6.0 & v8.11.1\r\n* NPM Version:  v6.1.0 & v5.8.0\r\n* webpack Version: v4.15.1 & v3.12.0\r\n* file-loader Version: v1.1.11\r\n\r\n<!-- Please place an x (no spaces!) in all [ ] that apply -->\r\n\r\nThis issue is for a:\r\n\r\n- [x] **bug**\r\n- [ ] **feature** request\r\n- [ ] **modification** request\r\n\r\n### Description\r\n\r\n#### Webpack config\r\n\r\nWith `publicPath` in `output`\r\n\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/build/webpack.base.conf.js#L21\r\n\r\nbut no `publicPath` in `file-loader`'s `options`\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/build/webpack.base.conf.js#L43-L49\r\n\r\n#### Use case in Vue\r\n\r\nIntroduce same image in both `img:src` and `background-image: url()`\r\n\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/src/App.vue#L3\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/src/App.vue#L23\r\n\r\n#### Expected Behavior\r\n\r\nBoth of them have `publicPath` after compiling.\r\n\r\n#### Actual Behavior\r\n\r\n`background-image: url()` is compiled with `publicPath` correctly, but `img:src` is not.\r\n\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/dist/static/css/app.7b93833f36168b8a692548c3f4b678cc.css#L1\r\n![image](https://user-images.githubusercontent.com/18205362/42683281-71a4a640-86bf-11e8-88fe-f3eb6010e64f.png)\r\n\r\n\r\nhttps://github.com/meteorlxy/repro-file-loader-bug/blob/c23b2a9a6818ea697a5ac382e738bd21a2e2d07b/dist/static/js/app.70725e77e25aa8a5765f.js#L1\r\n![image](https://user-images.githubusercontent.com/18205362/42683243-59d2c22c-86bf-11e8-8e58-c4465c775763.png)\r\n\r\n### How Do We Reproduce?\r\n\r\nFor fast repro, I generate a new Vue project via the cli & template.\r\n\r\nRepro repo: https://github.com/meteorlxy/repro-file-loader-bug\r\n\r\nI have also uploaded the `dist` files.\r\n\r\nTo build again:\r\n```\r\nyarn\r\nyarn build\r\n```\r\n\r\nThen check the production files `dist/static/js/app.xxx.js` and `dist/static/css/app.xxx.css`\r\n\r\n### What's more\r\n\r\nIf I set `publicPath` in `file-loader`'s `options` again, it works well.\r\n\r\nBut if I don't set `publicPath` in `file-loader`, and let `file-loader` to use `__webpack_public_path__`, this bug appears."},"comment":{"url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/comments/434407095","html_url":"https://github.com/webpack-contrib/file-loader/issues/286#issuecomment-434407095","issue_url":"https://api.github.com/repos/webpack-contrib/file-loader/issues/286","id":434407095,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDQwNzA5NQ==","user":{"login":"evilebottnawi","id":4567934,"node_id":"MDQ6VXNlcjQ1Njc5MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4567934?v=4","gravatar_id":"","url":"https://api.github.com/users/evilebottnawi","html_url":"https://github.com/evilebottnawi","followers_url":"https://api.github.com/users/evilebottnawi/followers","following_url":"https://api.github.com/users/evilebottnawi/following{/other_user}","gists_url":"https://api.github.com/users/evilebottnawi/gists{/gist_id}","starred_url":"https://api.github.com/users/evilebottnawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evilebottnawi/subscriptions","organizations_url":"https://api.github.com/users/evilebottnawi/orgs","repos_url":"https://api.github.com/users/evilebottnawi/repos","events_url":"https://api.github.com/users/evilebottnawi/events{/privacy}","received_events_url":"https://api.github.com/users/evilebottnawi/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T17:59:05Z","updated_at":"2018-10-30T17:59:05Z","author_association":"MEMBER","body":"@chrisckc can you create **minimum** reproducible test repo and describe what you have and what you expected in README, it is hard to understand what you mean"}}
{"actor":{"display_login":"evilebottnawi"}}