Appears like "const" is present in npm package
poldee-lgi opened this issue · 3 comments
It's difficult to debug because it's not possible from that output to tell which dist
file it's using.
However instead of UglifyJS
for your minification process, as that only supports ES5, you could try using something like minify.
Thanks for the quick response. Even if I didn't check quickly ;-)
It appears that I had an incompatible combination of version for babel, babel-loader, presets and .babelrc settings.
So if anybody gets a similar error message. That might be your problem.
FYI, this is the combination that currently works for me :-)
package.json
"devDependencies": { "@babel/core": "^7.9.6", "@babel/preset-env": "^7.9.6", "@babel/preset-react": "^7.9.4", "babel-loader": "^8.1.0", "uglifyjs-webpack-plugin": "^2.2.0", ... },
.babelrc
{ "presets": ["@babel/preset-env", "@babel/preset-react"] }
Awesome — and thanks for providing a solution for others 👍