title: webpack-dev-server and webpack -> output file to parent directory and have webpack-dev-server hot reloading still working
body: <p>We have the following structure in our web application:</p>
  
  <pre><code>/src(.sln)
  --/ClientSite
  --/AdminSite
  --/SharedWeb
  </code></pre>
  
  <p>In <code>SharedWeb</code> we have the following folders:</p>
  
  <pre><code>--/Client
  --/Admin
  --/Shared
  </code></pre>
  
  <p>We have this structure in order to have hot reloading with <code>webpack-dev-server</code> no matter what file we edit and only have one <code>package.json</code> etc. Thread about why we choose this structure if anyone is interested:</p>
  
  <p><a href="https://stackoverflow.com/questions/48264414/shared-react-front-end-components-separate-project-with-typescript-visual/48265628#48265628">Shared react front end components -&gt; Separate project with TypeScript -&gt; Visual Studio 2017</a></p>
  
  <p>Everything has worked fine so far but now that we need to deploy our solution we need to export the <code>bundle.js</code> to the correct site.</p>
  
  <p>In <code>webpack.client.config.js</code>:</p>
  
  <p>Works fine with hot reloading but script file is not exported to the site correctly:</p>
  
  <pre><code>output: {
      filename: "./Scripts/dist/[name].bundle.js",
  },
  </code></pre>
  
  <p>Script file is exported correctly but hot reloading stops working:</p>
  
  <pre><code>output: {
      filename: "../ClientSite/Scripts/dist/[name].bundle.js",
  },
  </code></pre>
  
  <p>Correct way with using path and filename according to documentation, nothing works:</p>
  
  <pre><code>output: {
      path: path.resolve(__dirname, "Scripts/dist/"),
      filename: "[name].bundle.js"
  }
  </code></pre>
  
  <p>Script file is exported correctly but hot reloading does not work. If I use <code>webpack</code> with <code>--watch</code> and manually reload <code>webpack-dev-server</code> URL I can see the changes but it does not reload automatically.</p>
  
  <pre><code>output: {
      path: path.resolve(__dirname, "../ClientSite/Scripts/dist/"),
      filename: "[name].bundle.js"
  },
  </code></pre>