Home > Back-end >  how to obfuscate react component or jsx file
how to obfuscate react component or jsx file

Time:02-03

i have to share a github repository with others but don't wanna expose my react component

i want to obfuscate a jsx files containing react functional component, styled-components, axios...

nonetheless, still "npm start" or "npm run dev" works in react/next.js

how should i do? is there a solution for this?

or can it be a solution to transform jsx file into obfuscated node moudle?

"how to obfuscate" i searched are focused on build time, full project.

i want it to work for dev time, partially

CodePudding user response:

Obfuscating it within the project will be a nightmare.

My suggestion would be to simply extract the component out into a separate library, build it, publish it, and then add it in your shared project as a dependency.

Then it will only exist as a compiled react component in the node_modules folder.

  • Related