I want to obfuscate my js file inside in public/js, but before it will obfuscate, is it possible to transfer first in other directory outside in my public folder then the result of obfuscate will be in public/js ?
Thank you in advance.
Best Answer
My answer is coming quite late however I recommend https://obfuscator.io/.
It works both standalone or as a webpack plugin.
I'm using it in one of my project with the default settings. The project is written in TS compiled and then obfuscated with this plugin. Even with the basic settings it changes the code a lot. I didn't notice any side effects.
If you need both obfuscated and unobfuscated code you could for example duplicate the entry points and add the duplicates to JavaScriptObfuscator exclusions.
You may also look at Uglify JS, it's more like a compressor tool, but its mangler may fit your needs. You can then configure includes/excludes to work with your folder layout.
https://webpack.js.org/plugins/uglifyjs-webpack-plugin/
Install "webpack-obfuscator" and configure your webpack file to obfuscator all your js files.
npm install --save-dev webpack-obfuscator