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

Gulp plugin for javascript-obfuscator package.

NotificationsYou must be signed in to change notification settings

javascript-obfuscator/gulp-javascript-obfuscator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp plugin forjavascript-obfuscator

Installation

Install the package with npm:

$ npm install --save gulp-javascript-obfuscator

Usage

constgulp=require('gulp');constjavascriptObfuscator=require('gulp-javascript-obfuscator');gulp.src('file.js').pipe(javascriptObfuscator()).pipe(gulp.dest('dist'));

Options

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.

Source Maps

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

Alternative source maps method

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp