How to obfuscate react code using terser or uglify-js? When .JS file has tag in it?

I have tried both npm packages to obfuscate react code.
I tried below code is inside package.json in script object
“minify:js”: “uglifyjs ./src/folder1/folder2/filename.js -c -m -o ./Build/filename.js”
and i run npm run minify:js and got below error.
Parse error at ./src/folder1/folder2/filename.js:15,8
<IconButton
^
ERROR: Unexpected token: operator «<».

The filename.js file has html tag content in it. It reruns an HTML element <IconButton. Because of that, it is throwing an error.

I am providing the code
enter image description here