-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (36 loc) · 1.09 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
const
gulp = require('gulp'),
pug = require('gulp-pug'),
browserSync = require('browser-sync'),
reload = browserSync.reload;
// Browser-sync task
gulp.task('browserSync', function() {
browserSync({
server: {
baseDir: './demo',
}
});
});
gulp.task('pug', () => {
return gulp.src('./src/pug/templates/*.pug')
.pipe(pug({ pretty: true }))
.pipe(gulp.dest('./dist'))
.pipe(gulp.dest('./demo/templates'))
.pipe(reload({ stream: true }));
});
gulp.task('demo', () => {
return [
gulp.src('./node_modules/brickyeditor/dist/**/*')
.pipe(gulp.dest('./demo/lib'))
.pipe(reload({ stream: true })),
gulp.src('./src/pug/demo/pages/*.pug')
.pipe(pug({ pretty: true }))
.pipe(gulp.dest('./demo'))
.pipe(reload({ stream: true }))
]
});
// changes tracking
gulp.task('watcher',function(){
gulp.watch('./src/pug/**/*', ['pug', 'demo']);
});
gulp.task('default', ['pug', 'demo', 'watcher', 'browserSync']);