Wildhoney/ReactShadow

Appears like "const" is present in npm package

poldee-lgi opened this issue · 3 comments

My project works great with react-shadow YEAH!!

However, when I try to do a prod build I get the following error.
BuildProblem

If I uninstall react-shadow and do my build everything works fine.

Can you help? What do you need from me to provide help?

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 👍