0

I'm in the process of upgrading my old node 8x project to node 18.18.0. When building a webpack angularjs app I get this error and unsure how to handle this issue. Is this a bug in webpack/webpack-cli or me?

The command I run is


webpack --config webpack.dev.js -d source-map  --node-env development --progress --watch

The webpack.dev.js configuration is

const webpack = require('webpack');
const commonConfigFactory = require("./webpack.common.js");
const merge = require('webpack-merge');
const path = require('path');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

const baseDir = path.resolve(__dirname);

module.exports = merge(commonConfigFactory({ ENV: 'development' }), 
  {    
    plugins: [
      new BundleAnalyzerPlugin({
        analyzerMode: 'static',
        openAnalyzer: false,
        reportFilename: 'analyze.html',
      }),
    ],
    mode: 'development',
    module: {      
      rules: [
        { test: /\.css$/, use: 'css-loader' },
        { test: /\.ts$/, use: 'ts-loader' },
      ],
    }
  });

I've tried changing optimizations, removing optimizations entirely but nothing changes the outcome.

I was hoping to build all .ts files and produce a bundle.js file

2
  • Do you need to include the optimization: {mangleWasmImports: true} to your module.exports "thing"?
    – ewokx
    Commented Sep 26, 2023 at 0:44
  • yes I tried that but still no cigar.. maybe in a different location in the config file I suppose?
    – jammerman
    Commented Sep 26, 2023 at 18:12

0