title: Browser console not seeing JavaScript variables using Webpack's dev server
body: <p>Im using Webpack's dev server. It loads up a working page fine however I don't have access to JavaScript variables in my browser console. EG if I have the following in a JavaScript file:</p>
  
  <pre><code>const body = document.querySelector('body');
  </code></pre>
  
  <p>Then entering <code>body</code> in my browser console says its not defined. </p>
  
  <p>Im using Webpack 3.5.5 (latest). Im running the build script from my package.json:</p>
  
  <pre><code>"scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1",
      "build": "webpack",
      "watch": "webpack --watch",
      "start": "webpack-dev-server --open"
    },
  </code></pre>
  
  <p>In my webpack.config.js I was specifying the devServer but removing it seems to make no difference. </p>
  
  <pre><code>const path = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  
  module.exports = {
    entry: './src/script.js',
    /*
    devServer: {
      contentBase: './dist'
    },
    */
  </code></pre>
  
  <p>Is this a configuration issue or is there another way that your supposed to access JavaScript variables? </p>