title: When I run the dev server, I got an error 'Uncaught ReferenceError: require is not defined' in external "url"
body: <p>I have just started to study Webpack and trying to setup development environment based on Webpack4.</p>
  
  <p>I put one script for executing dev server in <code>package.json</code> like below.</p>
  
  <p># <strong>package.json</strong></p>
  
  <pre><code>    "scripts": {
          "dev": "webpack-dev-server --mode development",
      }
  </code></pre>
  
  <p>However, there was an error message like below when I execute<code>'npm run dev'</code> on my terminal.</p>
  
  <pre><code>ERROR in ./node_modules/destroy/index.js
  Module not found: Error: Can't resolve 'fs' in 'D:\webpack-setup\node_modules\destroy'
   @ ./node_modules/destroy/index.js 14:17-30
  </code></pre>
  
  <p>So, I installed <code>'webpack-node-externals'</code> and put configuration in <code>'webpack.config.js'</code> like below.</p>
  
  <p># <strong>install webpack-node-externals module</strong></p>
  
  <pre><code>    # npm install --save-dev webpack-node-externals
  </code></pre>
  
  <p># <strong>webpack.config.js</strong></p>
  
  <pre><code>    const nodeExternals = require('webpack-node-externals');
  
      module.exports = {
          target: 'web',
          externals: [nodeExternals()],
          devServer: {
              host: 'localhost',
              port: 3000,
              open: true
          }
      };
  </code></pre>
  
  <p>When a browser was opened, there was an error on a browser like below.</p>
  
  <pre><code>Uncaught ReferenceError: require is not defined
      at eval (external_"url":1)
      at Object.url (main.js:289)
      at __webpack_require__ (main.js:20)
      at Object.eval (webpack:///(:3000/webpack)-dev-server/client?:6:11)
      at eval (webpack:///(:3000/webpack)-dev-server/client?:249:30)
      at Object../node_modules/webpack-dev-server/client/index.js?http://localhost:3000 (main.js:97)
      at __webpack_require__ (main.js:20)
      at eval (webpack:///multi_(:3000/webpack)-dev-server/client?:1:1)
      at Object.0 (main.js:190)
      at __webpack_require__ (main.js:20)
  </code></pre>
  
  <p>I'm not sure this error is related to <code>'webpack-node-externals'</code> module or not,
  but could I get some guide for solving this situation?</p>