-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·69 lines (63 loc) · 2.12 KB
/
gulpfile.js
File metadata and controls
executable file
·69 lines (63 loc) · 2.12 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Load Gulp
var gulp = require('gulp'),
gutil = require('gulp-util'),
plugins = require('gulp-load-plugins')({
rename: {
'gulp-live-server': 'serve'
}
});
// Start Watching: Run "gulp"
gulp.task('default', ['watch']);
// Run "gulp server"
gulp.task('server', ['serve', 'watch']);
// Minify Custom JS: Run manually with: "gulp build-js"
gulp.task('build-js', function () {
return gulp.src(['clientlibs/js/util.js',
'clientlibs/components/image/polyfills.js',
'clientlibs/components/image/image.js',
'clientlibs/components/sharing/sharing.js',
'clientlibs/components/search/search.js',
'clientlibs/components/navigation/navigation.js',
'clientlibs/components/teaser/teaser.js'])
.pipe(plugins.concat('base.js'))
.pipe(gulp.dest('build'));
});
// Less to CSS: Run manually with: "gulp build-css"
gulp.task('build-css', function () {
return gulp.src('clientlibs/base.less')
.pipe(plugins.plumber())
.pipe(plugins.less())
.on('error', function (err) {
gutil.log(err);
this.emit('end');
})
.pipe(plugins.autoprefixer({
browsers: [
'> 1%',
'last 2 versions',
'firefox >= 4',
'safari 7',
'safari 8',
'IE 8',
'IE 9',
'IE 10',
'IE 11'
],
cascade: false
}))
.pipe(gulp.dest('build')).on('error', gutil.log);
});
// Default task
gulp.task('watch', function () {
gulp.watch('clientlibs/**/*.js', ['build-js']);
gulp.watch('clientlibs/**/*.less', ['build-css']);
});
// Folder "/" serving at http://localhost:8888
// Should use Livereload (http://livereload.com/extensions/)
gulp.task('serve', function () {
var server = plugins.serve.static('/', 8888);
server.start();
gulp.watch(['build/*'], function (file) {
server.notify.apply(server, [file]);
});
});