Skip to content Skip to sidebar Skip to footer

Obfuscating Js Files With Grunt-obfuscator: Uncaught Referenceerror: Require Is Not Defined

I was searching over the internet about how to obfuscate my JavaScript code and after use uglify that convert all my files minified but not obfuscated I decided to use grunt-obfusc

Solution 1:

there are several questions here.

Do I need to obfuscate all my js files in order to get this run? no

An obfuscate file can work perfect with all your dependencies NON-obfuscated? yes

What am I missing? Hard to tell, uglification can be very tricky. First I'll verify if dependencies injections are well done or you can use ngAnnotate to do that for you dependency shall be defined as example bellow:

.service('myService',['$rootScope',function($rootScope){ ... }]);

If that does not solve your issue, you have to dig on requireJS that seems to send an issue

Edit your code and paste your main.js for us see what you are trying to uglify

Post a Comment for "Obfuscating Js Files With Grunt-obfuscator: Uncaught Referenceerror: Require Is Not Defined"