- Notifications
You must be signed in to change notification settings - Fork37
javascript-obfuscator/gulp-javascript-obfuscator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Gulp plugin forjavascript-obfuscator
Install the package with npm:
$ npm install --save gulp-javascript-obfuscator
constgulp=require('gulp');constjavascriptObfuscator=require('gulp-javascript-obfuscator');gulp.src('file.js').pipe(javascriptObfuscator()).pipe(gulp.dest('dist'));
Pass any options available in the obfuscator
gulp.src('file.js').pipe(javascriptObfuscator({compact:true})).pipe(gulp.dest('dist'));
The only exception is obfuscator'ssourceMap
option which must not be set, as it will be handled automatically when usinggulp-sourcemaps
.
With version1.1.6
onwards, gulp-javascript-obfuscator can be used in tandem withgulp-sourcemaps in order to generate source maps for your javascript files.
You will need to initialize gulp-sourcemaps prior to running gulp-javascript-obfuscator and write the source maps after, as such:
constsourcemaps=require('gulp-sourcemaps');gulp.src('file.js').pipe(sourcemaps.init()).pipe(javascriptObfuscator({compact:true})).pipe(sourcemaps.write()).pipe(gulp.dest('dist'));
This will output afile.js.map
file to thedist directory.
You can chain other gulp plugins as well:
constsourcemaps=require('gulp-sourcemaps');gulp.src('file.js').pipe(sourcemaps.init())// use babel to pre-process javascript files.pipe(babel({presets:['@babel/preset-env']})).pipe(javascriptObfuscator({compact:true})).pipe(sourcemaps.write()).pipe(gulp.dest('dist'));
For backwards compatibility, ifgulp-sourcemaps
is not used and obfuscator'ssourceMap option is set totrue, a.map file will be thrown to Gulp stream. (This method isdeprecated and not recommended for future use.)
About
Gulp plugin for javascript-obfuscator package.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.