gulp-obfuscate
gulp-obfuscate copied to clipboard
Obfuscator brakes the code
Obfuscator brakes working code after processing and not working correctly with gulp-sourcemaps
. My task looks like the following:
return gulp.src(paths.src.js)
.pipe(gulpif((process.env.ENV !== "production"), sourcemaps.init()))
.pipe(concat("all.js"))
.pipe(obfuscate({
replaceMethod: obfuscate.ZALGO
}))
.pipe(uglify())
.pipe(gulpif((process.env.ENV !== "production"), sourcemaps.write()))
.pipe(gulp.dest(paths.dist.js));
Uglify is optional of course and the same thing happens without it. First of all sourcemaps are not supported, but it's not the most important case.
There are a lot of broken code reporting errors such as undefined is not a function
or cannot access property of undefined
. For example this happens for Object.keys
method and other core javascript methods as well as global variables and variables inside clojures. Tried to add such keywords to exclude
but can't get rid of all errors.
+1
same here. one example for all:
function test(){} alert('test')
is changed to functionಠ_ಠ727() {} alert("ಠ_ಠ727")
as you can see, string inside alert was changed because there was a function named test
.
correct output should be alert('test')
(its the same with single or double quotes)
also a space between function
and a changed function name ಠ_ಠ727
was removed.
correct output should be function ಠ_ಠ727() {}
+1
This also breaks an AngularJS application. Meaning:
[ "$http", function($http) {
has to always be:
[ "$http", function( ಠ_ಠ727 ) {
instead of:
[ "ಠ_ಠ727", function( ಠ_ಠ727 ) {
The same issue, seems the owner is no longer developing it.
The same with nodejs
module.exports
gets broken. I use gulp-uglify which worked for me.
it still happening?
Same problems for me, changing the replaceMethod: obfuscate.ZALGO is giving me errors also.