{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/style-loader/issues/92","labels_url":"https://api.github.com/repos/webpack/style-loader/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/webpack/style-loader/issues/92/comments","events_url":"https://api.github.com/repos/webpack/style-loader/issues/92/events","html_url":"https://github.com/webpack/style-loader/issues/92","id":117088876,"number":92,"title":"__webpack_public_path__ is not defined","user":{"login":"Zorgatone","id":2664036,"avatar_url":"https://avatars.githubusercontent.com/u/2664036?v=3","gravatar_id":"","url":"https://api.github.com/users/Zorgatone","html_url":"https://github.com/Zorgatone","followers_url":"https://api.github.com/users/Zorgatone/followers","following_url":"https://api.github.com/users/Zorgatone/following{/other_user}","gists_url":"https://api.github.com/users/Zorgatone/gists{/gist_id}","starred_url":"https://api.github.com/users/Zorgatone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zorgatone/subscriptions","organizations_url":"https://api.github.com/users/Zorgatone/orgs","repos_url":"https://api.github.com/users/Zorgatone/repos","events_url":"https://api.github.com/users/Zorgatone/events{/privacy}","received_events_url":"https://api.github.com/users/Zorgatone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-16T10:03:08Z","updated_at":"2015-11-16T10:14:29Z","closed_at":null,"body":"I get this error on the browser: `__webpack_public_path__ is not defined` when I require a style (css or scss) from `bower_components` which uses `@font-face`.\r\n\r\nThis works if I move the files from `bower_components` to my root folder.\r\n\r\nI get in the bundle a list of fonts like this:\r\n```javascript\r\nfunction(module, exports, __webpack_require__) {\r\n    module.exports = __webpack_public_path__ + \"2c2ae068be3b089e0a5b59abb1831550.eot\"\r\n}\r\n```\r\n\r\nI'm getting `css`, `scss` and the fonts with this loaders:\r\n```javascript\r\n\"module\": {\r\n    \"loaders\": [{\r\n        \"test\":   /\\.css$/,\r\n        \"loader\": \"style!css\"\r\n    }, {\r\n        \"test\":   /\\.scss$/,\r\n        \"loader\": \"style!css!sass\"\r\n    }, {\r\n        \"test\":   /\\.(woff2?|ttf|eot|svg)/,\r\n        \"loader\": \"file\"\r\n    }]\r\n}\r\n```\r\n\r\nWhat's going on? :cry: "},"comment":{"url":"https://api.github.com/repos/webpack/style-loader/issues/comments/156978507","html_url":"https://github.com/webpack/style-loader/issues/92#issuecomment-156978507","issue_url":"https://api.github.com/repos/webpack/style-loader/issues/92","id":156978507,"user":{"login":"Zorgatone","id":2664036,"avatar_url":"https://avatars.githubusercontent.com/u/2664036?v=3","gravatar_id":"","url":"https://api.github.com/users/Zorgatone","html_url":"https://github.com/Zorgatone","followers_url":"https://api.github.com/users/Zorgatone/followers","following_url":"https://api.github.com/users/Zorgatone/following{/other_user}","gists_url":"https://api.github.com/users/Zorgatone/gists{/gist_id}","starred_url":"https://api.github.com/users/Zorgatone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zorgatone/subscriptions","organizations_url":"https://api.github.com/users/Zorgatone/orgs","repos_url":"https://api.github.com/users/Zorgatone/repos","events_url":"https://api.github.com/users/Zorgatone/events{/privacy}","received_events_url":"https://api.github.com/users/Zorgatone/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T10:14:29Z","updated_at":"2015-11-16T10:14:29Z","body":"Update: tried to switch from `scss` to `css`, always loading the style from `bower_components`.\r\n\r\nBefore I was doing:\r\n\r\n```javascript\r\nrequire(\"scss/my_app.scss\");\r\n```\r\n\r\nAnd in my `my_app.scss` file I had:\r\n```scss\r\n@import \"mybowerlib/scss/lib.scss\";\r\n```\r\n\r\n`mybowerlib/scss/lib.scss` contains the `@font-face` part.\r\n\r\nAnd I was getting the error `__webpack_public_path__ is not defined`.\r\n\r\n- - -\r\n\r\nAnd now that I've switched from `scss` to `css` I'm doing this:\r\n\r\n```javascript\r\nrequire(\"mybowerlib/css/lib.css\");\r\n```\r\n\r\n`mybowerlib/css/lib.css` contains the `@font-face` part.\r\n\r\nNow in the bundle.js I have all the require `undefined`. This is the error: `Uncaught ReferenceError: require is not defined`\r\n\r\nAnd this is the generated JS:\r\n\r\n```javascript\r\n    function(module, exports) {\r\n\r\n\t// style-loader: Adds some css to the DOM by adding a <style> tag\r\n\r\n\t// load the styles\r\n\tvar content = require(\"!!./../../../../node_modules/css-loader/index.js!./ionic.css\");\r\n\tif(typeof content === 'string') content = [[module.id, content, '']];\r\n\t// add the styles to the DOM\r\n\tvar update = require(\"!./../../../../node_modules/style-loader/addStyles.js\")(content, {});\r\n\tif(content.locals) module.exports = content.locals;\r\n\t// Hot Module Replacement\r\n\tif(module.hot) {\r\n\t\t// When the styles change, update the <style> tags\r\n\t\tif(!content.locals) {\r\n\t\t\tmodule.hot.accept(\"!!./../../../../node_modules/css-loader/index.js!./ionic.css\", function() {\r\n\t\t\t\tvar newContent = require(\"!!./../../../../node_modules/css-loader/index.js!./ionic.css\");\r\n\t\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\r\n\t\t\t\tupdate(newContent);\r\n\t\t\t});\r\n\t\t}\r\n\t\t// When the module is disposed, remove the <style> tags\r\n\t\tmodule.hot.dispose(function() { update(); });\r\n    }\r\n```"}}