I'm not sure whether this is a babel-minify-webpack-plugin or a babel-minify plugin.
I supposed the latter so I reported this bug there (https://github.com/babel/minify/issues/711) but for sake of completeness I'm reporting it here as well in case anybody else is facing the same.
What happens?
It looks like classes are converted to functions instead of ES6 classes. It's not up to modules: it's triggered by tons of them, I manually tried to remove dependencies but this pop up anyway for most of them.
Uncaught TypeError: Class constructor _class2 cannot be invoked without 'new'
at exports.default (jszip.js:13)
at jszip.js:13
npm install -g yarn pm2
yarn install
yarn serve:dev //run pm2 to serve the website
yarn build:dev //run webpack without minifying and everything is fine at http://localhost:8080
yarn build:prod //run this to run webpack with minifying and http://localhost:8080 is broken
Babel versions and plugins
I'm using babel-preset-env and babel-minify-webpack-plugin and I tried both the following minify options:
new BabelMinifyPlugin(), //everything on
new BabelMinifyPlugin({ mangle: false, evaluate: false, propertyLiterals: false }), //no mangle at all
I'm not sure whether this is a
babel-minify-webpack-plugin
or ababel-minify
plugin. I supposed the latter so I reported this bug there (https://github.com/babel/minify/issues/711) but for sake of completeness I'm reporting it here as well in case anybody else is facing the same.What happens? It looks like classes are converted to functions instead of ES6 classes. It's not up to modules: it's triggered by tons of them, I manually tried to remove dependencies but this pop up anyway for most of them.
REPRO https://github.com/damianobarbati/babel-minify-bug Instructions in README.
Babel versions and plugins I'm using babel-preset-env and babel-minify-webpack-plugin and I tried both the following minify options:
Config and versions: