- Notifications
You must be signed in to change notification settings - Fork21
Grunt plugin for the javascript-obfuscator package.
License
javascript-obfuscator/grunt-contrib-obfuscator
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Obfuscate JavaScript files usingjavascript-obfuscator@^2.0.0.
You can try the javascript-obfuscator module and see all its options here:https://obfuscator.io/
If you haven't usedGrunt before, be sure to check out theGetting Started guide, as it explains how to create aGruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-contrib-obfuscator --save-devnpm install javascript-obfuscator --save-dev
Notice that you should install manuallyjavascript-obfuscator. This makes it easier to have a newer version of the obfuscator library if needed.
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of #"auto" data-snippet-clipboard-copy-content="grunt.loadNpmTasks('grunt-contrib-obfuscator');">
grunt.loadNpmTasks('grunt-contrib-obfuscator');
Run this task with thegrunt obfuscator command.
Task targets, files and options may be specified according to the gruntConfiguring tasks guide.
See the options on the obfuscator repo.
Note that at this time thesourceMap isn't implemented in this plugin.
In addition to the obfuscator options, you can also use:
Type:StringDefault:''
This string will be prepended to the obfuscated output. Template strings (e.g.<%= config.value %> will be expanded automatically.
This configuration will obfuscate the input files using the default options.
obfuscator:{options:{// global options for the obfuscator},task1:{options:{// options for each sub task},files:{'dest/output.js':['src/js/file1.js','src/js/file2.js']}}}
This configuration will obfuscate the input files in a destination folder by keeping the original names and directories
obfuscator:{options:{// global options for the obfuscator},task1:{options:{// options for each sub task},files:{'dest/':[// the files and their directories will be created in this folder'src/js/file1.js','src/js/folder/file2.js']}}}
Here you code will be protected against debugging and locked to the domainwww.example.com.
obfuscator:{options:{banner:'// obfuscated with grunt-contrib-obfuscator.\n',debugProtection:true,debugProtectionInterval:true,domainLock:['www.example.com']},task1:{options:{// options for each sub task},files:{'dest/output.js':['src/js/file1.js','src/js/file2.js']}}}
About
Grunt plugin for the javascript-obfuscator package.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.