{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/362","labels_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/362/comments","events_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/362/events","html_url":"https://github.com/webpack/webpack-dev-server/issues/362","id":124969208,"number":362,"title":"webpack dev server cannot serve files in `contentBase` directory","user":{"login":"kerryChen95","id":1589388,"avatar_url":"https://avatars.githubusercontent.com/u/1589388?v=3","gravatar_id":"","url":"https://api.github.com/users/kerryChen95","html_url":"https://github.com/kerryChen95","followers_url":"https://api.github.com/users/kerryChen95/followers","following_url":"https://api.github.com/users/kerryChen95/following{/other_user}","gists_url":"https://api.github.com/users/kerryChen95/gists{/gist_id}","starred_url":"https://api.github.com/users/kerryChen95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerryChen95/subscriptions","organizations_url":"https://api.github.com/users/kerryChen95/orgs","repos_url":"https://api.github.com/users/kerryChen95/repos","events_url":"https://api.github.com/users/kerryChen95/events{/privacy}","received_events_url":"https://api.github.com/users/kerryChen95/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-05T13:44:46Z","updated_at":"2016-01-26T09:27:04Z","closed_at":null,"body":"My webpack config is:\r\n```\r\nvar webpack = require('webpack')\r\nvar WebpackDevServer = require('webpack-dev-server')\r\nvar HtmlWebpackPlugin = require('html-webpack-plugin')\r\nvar path = require('path')\r\nvar config = {\r\n  entry: {\r\n    main: 'src/main.js',\r\n  },\r\n  output: {\r\n    path: path.resolve('dist/static'),\r\n    fileName: '[name].js',\r\n  },\r\n  plugins: [\r\n    new HtmlWebpackPlugin({\r\n      filename: '../index.html',\r\n    })\r\n  ],\r\n}\r\n```\r\n\r\nI want to use webpack & html-webpack-plugin to output files as below:\r\n```\r\ndist/index.html\r\ndist/static/main.js\r\n```\r\n\r\nWhen I use webpack to write file into disk as below, files are outputted as my expectation.\r\n```\r\nwebpack(config).run(function () {})\r\n```\r\n\r\nBut when I clear `dist` directory, then use webpack-dev-server to serve files from memory as below, the URL `localhost:8080/index.html` return 404.\r\n```\r\nvar compiler = webpack(config)\r\nvar server = WebpackDevServer(compiler, {\r\n  contentBase: path.resolve('dist'),\r\n})\r\n```\r\n\r\nVersion info:\r\nhtml-webpack-plugin@1.7.0\r\nwebpack@1.12.9\r\nwebpack-core@0.6.8\r\nwebpack-dev-middleware@1.4.0\r\nwebpack-dev-server@1.14.0"},"comment":{"url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/comments/174921603","html_url":"https://github.com/webpack/webpack-dev-server/issues/362#issuecomment-174921603","issue_url":"https://api.github.com/repos/webpack/webpack-dev-server/issues/362","id":174921603,"user":{"login":"cebor","id":1576120,"avatar_url":"https://avatars.githubusercontent.com/u/1576120?v=3","gravatar_id":"","url":"https://api.github.com/users/cebor","html_url":"https://github.com/cebor","followers_url":"https://api.github.com/users/cebor/followers","following_url":"https://api.github.com/users/cebor/following{/other_user}","gists_url":"https://api.github.com/users/cebor/gists{/gist_id}","starred_url":"https://api.github.com/users/cebor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebor/subscriptions","organizations_url":"https://api.github.com/users/cebor/orgs","repos_url":"https://api.github.com/users/cebor/repos","events_url":"https://api.github.com/users/cebor/events{/privacy}","received_events_url":"https://api.github.com/users/cebor/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T09:27:04Z","updated_at":"2016-01-26T09:27:04Z","body":"same issue, with latest 1.x version"}}