-
Notifications
You must be signed in to change notification settings - Fork 24
/
gulpfile.js
48 lines (42 loc) · 1.06 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
'use strict';
var browserSync = require('browser-sync');
var gulp = require('gulp');
var through = require('through2');
var plugins = require('gulp-load-plugins')();
var config = {
buildDir: 'app/assets/build',
minify: false
};
gulp.task('less', function () {
return gulp.src('app/assets/less/style.less')
.pipe(plugins.less({ compress: true }))
.on('error', function (err) {
var parseError = plugins.util.colors.red.bold('Parse error:');
plugins.util.log(parseError, err.message);
})
.pipe(plugins.autoprefixer())
.pipe(config.minify ? plugins.minifyCss() : through.obj())
.pipe(gulp.dest(config.buildDir));
});
gulp.task('build', ['less']);
gulp.task('default', ['build'], function () {
gulp.watch('app/assets/less/**/*.less', ['less']);
browserSync.init([
'app/assets/build/style.css',
'app/assets/css/**/*.css',
// requirejs out,
'app/assets/imgs/**/*.jpg',
'app/assets/imgs/**/*.png',
'app/**/*.php',
'app/**/*.html'
], {
server: {
baseDir: './app/'
},
ghostMode: {
scroll: true,
links: true,
forms: true
}
});
});