title: webpack error while running npm run build
body: <p>I'm trying to install in vanilla typescript axios for HTTP Request, I use webpack as bundler but when I try to run my webpack I get error</p>
  <pre><code>[webpack-cli] Failed to load 'C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\webpack.config.js' config
  [webpack-cli] ReferenceError: path is not defined
      at Object.&lt;anonymous&gt; (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\webpack.config.js:17:11)
      at Module._compile (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)
      at require (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
      at WebpackCLI.tryRequireThenImport (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\node_modules\webpack-cli\lib\webpack-cli.js:32:22)
      at loadConfig (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\node_modules\webpack-cli\lib\webpack-cli.js:1536:38)
      at WebpackCLI.resolveConfig (C:\Users\lenovo\OneDrive\Desktop\Web Dev Stuff\Weather-API\node_modules\webpack-cli\lib\webpack-cli.js:1639:44)
  </code></pre>
  <p>also this is my webpack.config.json</p>
  <pre class="lang-js prettyprint-override"><code>module.exports = {
    entry: './src/app.ts',
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/,
        },
      ],
    },
    resolve: {
      extensions: ['.tsx', '.ts', '.js'],
    },
    output: {
      filename: 'app.js',
      path: path.resolve(__dirname, 'public/dist'),
    },
  };
  </code></pre>
  <p>and this is my package.json to run my webpack</p>
  <pre class="lang-js prettyprint-override"><code>{
    &quot;name&quot;: &quot;weather-api&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;weather-api&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;build&quot;: &quot;webpack&quot;,
      &quot;server&quot;: &quot;webpack-dev-server&quot;
    },
    &quot;author&quot;: &quot;callmenik&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;ts-loader&quot;: &quot;^9.2.3&quot;,
      &quot;webpack&quot;: &quot;^5.39.1&quot;,
      &quot;webpack-cli&quot;: &quot;^4.7.2&quot;
    },
    &quot;dependencies&quot;: {
      &quot;axios&quot;: &quot;^0.21.1&quot;,
      &quot;date.js&quot;: &quot;^0.3.3&quot;,
      &quot;datejs&quot;: &quot;^1.0.0-rc3&quot;
    }
  }
  </code></pre>
  <p>what do I do wrong?</p>