-
Notifications
You must be signed in to change notification settings - Fork 36
/
gulpfile.js
43 lines (39 loc) · 1.03 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
const gulp = require('gulp');
const webpack = require('webpack-stream');
const gp_childProcess = require('child_process');
const $ = require('gulp-load-plugins')({'camelize': true});
gulp.task('default', ['less', 'js', 'serve']);
gulp.task('less', function() {
return gulp.src('_less/style.less')
.pipe($.less())
.pipe(gulp.dest('_includes'))
.pipe($.cleanCss())
.pipe($.rename({
suffix: '.min'
}))
.pipe(gulp.dest('_includes'));
});
gulp.task('js', function() {
return gulp.src('_js/src/**/*.js')
.pipe($.concat('concat.js'))
.pipe(gulp.dest('_js/build'))
.pipe(webpack({
output: {
path: __dirname,
filename: "all.js"
},
module: {
loaders: []
}
}))
.pipe($.uglify())
.pipe($.rename({ extname: '.min.js' }))
.pipe(gulp.dest('scripts'));
});
gulp.task('serve', function(done) {
return gp_childProcess.spawn(
'bundle',
['exec', 'jekyll', 'serve', '--baseurl=', '--incremental'],
{ stdio: 'inherit' })
.on('close', done);
});