forked from better-studio/better-amp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (28 loc) · 975 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
var gulp = require('gulp'),
cleanCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify');
gulp.task('styles', function () {
return gulp.src(['./template/**/*.css', '!./template/**/*.min.css'])
.pipe(cleanCSS({
keepSpecialComments: 1,
level: 2
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(function (file) {
return file.base;
}));
});
gulp.task('scripts', function () {
return gulp.src(['./js/**/*.js', '!./js/**/*.min.js'])
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(function (file) {
return file.base;
}));
});
gulp.task('watch', function () {
gulp.watch(['./template/**/*.css', '!./template/**/*.min.css'], ['styles']);
gulp.watch(['./js/**/*.js', '!./js/**/*.min.js', '!./js/*.min.js'], ['scripts']);
});
gulp.task('default', ['styles', 'scripts']);