I'm trying to compile an express web API into a binary so that my source code can be protected.
I'm trying nexe. I noticed a few pitfalls such as __dirname and __filename's behavior will be modified. I certainly can modify my own code to avoid using these two variables. However, I cannot control node_modules I referenced, or I don't want to either as there're too many of them and modifying them will cause issues in subsequent version upgrade.
Do anyone has any advice on how to handle issues like this? I'm looking for possible directions:
- Compile my own code into binary, not the referenced node_modules, but still keep the reference when running the binary.
- A complete different way of source code protection?
I'm using windows.