title: Webpack-dev-server in sub directory - not compiling & no hot reloading
body: <p>I'm trying to run webpack dev server in a sub directory (public), so that I can integrate react into an existing site. </p>
  
  <p><a href="https://github.com/AshConnolly/minimal-react-webpack-starter" rel="nofollow noreferrer">Repo - minimal-react-webpack-starter</a></p>
  
  <p>When I run it from a sub directory, using <code>npm run start</code>, neither hot reloading or compilation work, but when I run them from root without <code>--content-base</code> or <code>devServer.publicPath</code> it works fine.   </p>
  
  <p>Folder structure - </p>
  
  <pre><code>|- App/
      |- node-modules/
      |- public/
          |- react/
              |- main.js
          |- index.html
      |- shared/
          |- react/
              |- components/
              |- main.js
  |- package.json
  |- webpack.config.js
  </code></pre>
  
  <p>The index.html contains <code>&lt;script src="react/main.js"&gt;&lt;/script&gt;</code></p>
  
  <p>Webpack config - </p>
  
  <pre><code>const path = require('path');
  
  const config = {
      entry: './shared/react/main.js',
      output: {
          publicPath: "public/react",
          path: path.resolve(__dirname, 'public/react'),
          filename: 'main.js',
      },
      module: {
          loaders: [
              { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
              { test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/ }
          ]
      },
      devServer: {
              inline: true,
               publicPath: "public/",
               contentBase: path.join(__dirname, "public"),
               hot: true,
               port: 8080,
          },
  
  }
  </code></pre>
  
  <p>pacakge.json - </p>
  
  <pre><code>{
  "name": "App",
  "version": "1.0.0",
  "repository": "Ash-repo",
  "description": "App",
  "devDependencies": {
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "path": "^0.12.7",
    "react": "^15.5.4",
    "react-dom": "^15.5.4",
    "webpack": "^2.5.0",
    "webpack-dev-server": "^2.4.5"
  },
  "scripts": {
    "start": "webpack-dev-server --content-base public/ --hot --progress --colors",
    "watch": "webpack --progress --colors --watch",
    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
  }
  }
  </code></pre>
  
  <p>Cant see why it isn't compiling or reloading, I've set up <code>publicPath</code> (in output and devServer) and <code>content-base</code> to point to public. I look at <code>http://localhost:8080/webpack-dev-server/</code> and <code>http://localhost:8080/</code> but no reload or compilation occurs!</p>
  
  <p>Any help would be greatly appreciated! </p>