-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
36 lines (30 loc) · 868 Bytes
/
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
var gulp = require('gulp');
var pug = require('gulp-pug');
var webpack = require('webpack');
gulp.task('html', function() {
gulp.src(['src/html/**/*.pug'])
.pipe(pug({pretty: true}))
.pipe(gulp.dest('output'));
});
gulp.task('webpack', function(callback) {
webpack(
require('./webpack.config.js'),
function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
callback();
}
);
});
gulp.task('static', function() {
gulp.src(['src/static/**/*'], { base: 'src/static' })
.pipe(gulp.dest('./output/static'));
gulp.src(['src/manifest.json'], { base: 'src' })
.pipe(gulp.dest('./output/'));
});
gulp.task('build', ['html', 'webpack', 'static']);
gulp.task('watch', function() {
gulp.watch("src/html/**/*.pug", ['html']);
});
gulp.task('default', ['build', 'watch'], function() {
// pass
});