-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
29 lines (26 loc) · 795 Bytes
/
gulpfile.js
File metadata and controls
29 lines (26 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require("gulp-concat"),
minifyCss = require("gulp-minify-css"),
rename = require('gulp-rename'),
header = require('gulp-header'),
banner = ['/**',
' * Created on : <%= date %>',
' * Author : <%= name %>',
' */',
''].join('\n');
/*合并压缩js*/
gulp.task('minjs', function() {
gulp.src(["js/jSelect.js"])
.pipe(uglify())
.pipe(rename({basename: "jSelect",
//prefix: new Date().getTime()+"-",
suffix: ".min",
extname: ".js"}))
.pipe(header(banner, { name : 'jinchangjiang',date:(new Date()).toString()}))
.pipe(gulp.dest('dist/'));
});
gulp.task('all',['minjs']);
gulp.task('default', function() {
gulp.watch(['js/*.js','css/*.css'], ['minjs','mincss']);
});