在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):duan602728596/gulp-terser开源软件地址(OpenSource Url):https://github.com/duan602728596/gulp-terser开源编程语言(OpenSource Language):JavaScript 82.7%开源软件介绍(OpenSource Introduction):gulp-terserGulp plugin, compressed es6+ code. Install
or
How to useconst gulp = require('gulp');
const terser = require('gulp-terser');
function es(){
return gulp.src('./src/index.js')
.pipe(terser())
.pipe(gulp.dest('./build'));
}
exports.default = es; OptionsTerser configuration can be viewed https://github.com/terser-js/terser#minify-options. const gulp = require('gulp');
const terser = require('gulp-terser');
function es(){
return gulp.src('./src/index.js')
.pipe(terser({
keep_fnames: true,
mangle: false
}))
.pipe(gulp.dest('./build'));
}
exports.default = es; Use a 3rd-party version of minifierconst gulp = require('gulp');
const terser = require('terser');
const gulpTerser = require('gulp-terser');
function es(){
return gulp.src('./src/index.js')
.pipe(gulpTerser({}, terser.minify))
.pipe(gulp.dest('./build'));
}
exports.default = es; Use sourcemapsYou can use sourcemaps like this: const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const terser = require('gulp-terser');
function es(){
return gulp.src('./src/**/*.js')
.pipe(sourcemaps.init())
.pipe(terser())
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./build'));
}
exports.default = es; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论