在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):javascript-obfuscator/gulp-javascript-obfuscator开源软件地址(OpenSource Url):https://github.com/javascript-obfuscator/gulp-javascript-obfuscator开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-javascript-obfuscatorGulp plugin for javascript-obfuscator InstallationInstall the package with npm: $ npm install --save gulp-javascript-obfuscator Usageconst gulp = require('gulp');
const javascriptObfuscator = require('gulp-javascript-obfuscator');
gulp.src('file.js')
.pipe(javascriptObfuscator())
.pipe(gulp.dest('dist')); OptionsPass any options available in the obfuscator gulp.src('file.js')
.pipe(javascriptObfuscator({
compact: true
}))
.pipe(gulp.dest('dist')); The only exception is obfuscator's Source MapsWith version You will need to initialize gulp-sourcemaps prior to running gulp-javascript-obfuscator and write the source maps after, as such: const sourcemaps = require('gulp-sourcemaps');
gulp.src('file.js')
.pipe(sourcemaps.init())
.pipe(javascriptObfuscator({
compact: true
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist')); This will output a You can chain other gulp plugins as well: const sourcemaps = 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 methodFor backwards compatibility, if |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论