Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Grunt plugin for the javascript-obfuscator package.

License

NotificationsYou must be signed in to change notification settings

javascript-obfuscator/grunt-contrib-obfuscator

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/

Getting Started

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');

Obfuscator task

Run this task with thegrunt obfuscator command.

Task targets, files and options may be specified according to the gruntConfiguring tasks guide.

Options

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:

banner

Type:StringDefault:''

This string will be prepended to the obfuscated output. Template strings (e.g.<%= config.value %> will be expanded automatically.

Usage examples

Default options

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']}}}

Debug protection and banner

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

Stars

Watchers

Forks

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp