title: webpack exclude property vs webpack-node-externals package
body: <p>In webpack server config file,</p>
  
  <pre><code>module: {
      rules: [
        {
          test: /\.js?$/,
          loader: "babel-loader",
          exclude: /node_modules/,
        }
      ]
    }
  </code></pre>
  
  <p>exclude means do not compile those directories, in this case it is only node_modules. However there is also <code>webpack-node-externals</code> package.</p>
  
  <pre><code>const nodeWebExternals = require("webpack-node-externals");
    externals: [nodeWebExternals()],
  </code></pre>
  
  <p>externals property inside module.exports object is going to tell webpack not to bundle any libraries into our output bundle on the server if that library exists inside the node-modules folder.</p>
  
  <p>What is the difference between those two?</p>