{"action":"created","issue":{"url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/1","repository_url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin","labels_url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/1/comments","events_url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/1/events","html_url":"https://github.com/goldhand/sw-precache-webpack-plugin/issues/1","id":157461815,"number":1,"title":"[help wanted] service-worker file is not server from top level ","user":{"login":"Andarist","id":9800850,"avatar_url":"https://avatars.githubusercontent.com/u/9800850?v=3","gravatar_id":"","url":"https://api.github.com/users/Andarist","html_url":"https://github.com/Andarist","followers_url":"https://api.github.com/users/Andarist/followers","following_url":"https://api.github.com/users/Andarist/following{/other_user}","gists_url":"https://api.github.com/users/Andarist/gists{/gist_id}","starred_url":"https://api.github.com/users/Andarist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andarist/subscriptions","organizations_url":"https://api.github.com/users/Andarist/orgs","repos_url":"https://api.github.com/users/Andarist/repos","events_url":"https://api.github.com/users/Andarist/events{/privacy}","received_events_url":"https://api.github.com/users/Andarist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-30T09:06:40Z","updated_at":"2016-05-31T15:42:12Z","closed_at":null,"body":"Hey,\r\n\r\nmy problem is probably cause of my lack of knowledge of the topic, but I'm struggling with it since yesterday and thought I might ask for a help eventually ;)\r\n\r\nI use pretty standard configs, however I cannot force webpack to serve generated service worker at top level of my app during development. In normal case I would just add new `entry` to the webpack configuration, but here I have no entry point for a `service-worker` file as it is generated from the scratch by a plugin. Is there any option to allow that now? \r\n\r\nmy `webpack.config.js` (important parts)\r\n```\r\nconst SWPrechaceConfig = require('./sw-precache-config')\r\nconst config = {\r\n\tcontext: __dirname,\r\n\tentry: {\r\n\t\tapp: ['./src/app/index'],\r\n\t},\r\n\toutput: {\r\n\t\tpath: path.resolve(__dirname, './dist'),\r\n\t\tfilename: '[name].js',\r\n\t},\r\n\tresolve: {\r\n\t\textensions: ['', '.es6', '.js', '.json'],\r\n\t},\r\n\tmodule: {\r\n\t\tpreLoaders: [\r\n\t\t\t{test: /\\.jsx?$/, loader: 'eslint', exclude: /node_modules/},\r\n\t\t],\r\n\t\tloaders: [\r\n\t\t\t{test: /\\.jsx?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/},\r\n\t\t\t{test: /\\.html$/, loader: 'raw'},\r\n\t\t\t{test: /\\.css$/, loader: 'css'},\r\n\t\t\t{test: /\\.styl$/, loader: 'style!css!postcss!stylus'},\r\n\t\t\t{test: /\\.json$/, loader: 'json'},\r\n\t\t\t{test: /\\.svg$/, loader: 'babel!svg-react'},\r\n\t\t],\r\n\t},\r\n\tplugins: [new SWPrecacheWebpackPlugin(SWPrechaceConfig)],\r\n}\r\n```\r\n\r\nand my `SWPrechaceConfig`:\r\n```\r\nmodule.exports = {\r\n\tcacheId: \"local_app\",\r\n\tmaximumFileSizeToCacheInBytes: 4194304,\r\n\truntimeCaching: [{\r\n\t\thandler: \"cacheFirst\",\r\n\t\turlPattern: /[.]mp3$/,\r\n\t}],\r\n\tstaticFileGlobs: [\r\n\t\t\"dist/app.js\"\r\n\t],\r\n\tstripPrefix: \"dist/\",\r\n\tverbose: true,\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/comments/222729493","html_url":"https://github.com/goldhand/sw-precache-webpack-plugin/issues/1#issuecomment-222729493","issue_url":"https://api.github.com/repos/goldhand/sw-precache-webpack-plugin/issues/1","id":222729493,"user":{"login":"goldhand","id":1919664,"avatar_url":"https://avatars.githubusercontent.com/u/1919664?v=3","gravatar_id":"","url":"https://api.github.com/users/goldhand","html_url":"https://github.com/goldhand","followers_url":"https://api.github.com/users/goldhand/followers","following_url":"https://api.github.com/users/goldhand/following{/other_user}","gists_url":"https://api.github.com/users/goldhand/gists{/gist_id}","starred_url":"https://api.github.com/users/goldhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldhand/subscriptions","organizations_url":"https://api.github.com/users/goldhand/orgs","repos_url":"https://api.github.com/users/goldhand/repos","events_url":"https://api.github.com/users/goldhand/events{/privacy}","received_events_url":"https://api.github.com/users/goldhand/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T15:42:12Z","updated_at":"2016-05-31T15:42:12Z","body":"So this shouldn't be an entry point, the service worker is generated after the build because it needs the bundled files in order to build. \r\nThis file should be added to your `dist/` folder after the build is done (which it sounds like it is).\r\n\r\nAre `app.js` and `service-worker.js` in the same folder?\r\n\r\nAlso did you add:\r\n```html\r\n<script>\r\nnavigator.serviceWorker.register('/service-worker.js');\r\n</script>\r\n```\r\nto your `index.html` file somewhere?"}}
{"actor":{"display_login":"goldhand"}}