在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):terinjokes/gulp-uglify开源软件地址(OpenSource Url):https://github.com/terinjokes/gulp-uglify开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-uglify
InstallationInstall package with NPM and add it to your development dependencies:
Usagevar gulp = require('gulp');
var uglify = require('gulp-uglify');
var pipeline = require('readable-stream').pipeline;
gulp.task('compress', function () {
return pipeline(
gulp.src('lib/*.js'),
uglify(),
gulp.dest('dist')
);
}); To help properly handle error conditions with Node streams, this project
recommends the use of
OptionsMost of the minify options from the UglifyJS API are supported. There are a few exceptions:
Errors
Most UglifyJS error messages have the following properties:
To see useful error messages, see Why Use Pipeline?. Using a Different UglifyJSBy default, var uglifyjs = require('uglify-js'); // can be a git checkout
// or another module (such as `uglify-es` for ES6 support)
var composer = require('gulp-uglify/composer');
var pump = require('pump');
var minify = composer(uglifyjs, console);
gulp.task('compress', function (cb) {
// the same options as described above
var options = {};
pump([
gulp.src('lib/*.js'),
minify(options),
gulp.dest('dist')
],
cb
);
}); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论