-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (50 loc) · 1.47 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins();
gulp.task('build', ['css', 'js', 'html']);
gulp.task('watch', function() {
gulp.watch('src/less/*.less', ['css']);
gulp.watch('src/js/*.js', ['js']);
gulp.watch('src/index.html', ['html']);
});
gulp.task('css', function () {
return gulp.src([
'src/less/desplo.less'
])
.pipe(plugins.plumber())
/* Sourcemap init before supported plugins */
.pipe(plugins.sourcemaps.init())
.pipe(plugins.less())
.pipe(plugins.autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(plugins.concat('desplo.css'))
/* Sourcemap write after supported plugins */
.pipe(plugins.sourcemaps.write())
.pipe(gulp.dest('build/css'))
.pipe(plugins.livereload());
});
gulp.task('js', function () {
return gulp.src([
'src/js/underscore.js',
'src/js/desplo.js'
])
.pipe(plugins.plumber())
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'))
/* Sourcemap init before supported plugins */
.pipe(plugins.sourcemaps.init())
.pipe(plugins.uglify())
.pipe(plugins.concat('desplo.js'))
/* Sourcemap write after supported plugins */
.pipe(plugins.sourcemaps.write())
.pipe(gulp.dest('build/js'))
.pipe(plugins.livereload());
});
gulp.task('html', function () {
return gulp.src('src/index.html')
.pipe(plugins.plumber())
.pipe(gulp.dest('build/'))
.pipe(plugins.livereload());
});