-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (27 loc) · 827 Bytes
/
gulpfile.js
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
30
31
32
33
34
35
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
path = require('path');
// ------------------------------------------
// paths
var paths = {
scripts: ['src/js/**/*.js']
};
gulp.task('scripts', function() {
return gulp.src([
'./src/js/handle.js'
])
.pipe(concat('jquery.srcset.js'))
// This will output the non-minified version
.pipe(gulp.dest('./dist/js'))
.pipe(gulp.dest('./'))
// This will minify and rename to foo.min.js
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('./dist/js'))
.pipe(gulp.dest('./'));
});
// ------------------------------------------
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['scripts']);