标签:示例 line 渲染 文件合并 命名 OLE eve rename gulp
var gulp = require('gulp');
var concat = require('concat');
var uglify = require('uglify');
gulp.task('js', function() {
gulp.src(['./js/index.js', './js/nav.js'])
//将文件合并成一个index.js文件
.pipe(concat('index.js'))
// 将文件进行丑化处理
.pipe(uglify({
'toplevel':true,
'compress': {
'drop_console': true,
'drop_debugger': true,
}
}))
//为文件进行重命名
.pipe(rename({'suffix': '.min'}))
.pipe(gulp.dest('./dist/js/'))
});
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
pipeline = require('readable-stream').pipeline;
gulp.task('js02', function() {
return pipeline(
gulp.src(['./js/index.js','./js/nav.js']),
concat('index.js'),
//压缩主要是依靠uglify()函数;
uglify(),
rename({
'suffix': '.min',
}),
gulp.dest('./dist/js/')
)
});
标签:示例 line 渲染 文件合并 命名 OLE eve rename gulp
原文地址:https://www.cnblogs.com/guyan-2020/p/12387362.html