We are starting to have ES6 classes show up in our...
# javascript
s
We are starting to have ES6 classes show up in our npm dependencies which breaks the generated code for super class constructor calling. I am sure it is possible to get webpack to transform it but my google-foo fails me. Can anyone help me out ?
Leaving the solution for anyone else here. The error is
Copy code
TypeError: Class constructor XXXX cannot be invoked without 'new'
Solution is this file `webpack.config.d/babel.js`:
Copy code
config.module.rules.push({
    test: /\.m?js$/,
    use: {
        loader: 'babel-loader',
        options: {
            plugins: [
                ["@babel/plugin-transform-classes"]
            ],
            assumptions: {
                "superIsCallableConstructor": false
            }
        },
    }
});