-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
31 lines (27 loc) · 942 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
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('browsersync', function() {
browserSync.init({
notify: false,
proxy: "127.0.0.1:8000"
});
gulp.watch(['./**/*.{scss,css,html,py,js}'], reload);
gulp.watch(['./**/*.hbs'], ['handlebars']);
});
var uglify = require('gulp-uglify'); // minify js file
var handlebars = require('gulp-handlebars'); // compile handlebar templates
var defineModule = require('gulp-define-module');
var declare = require('gulp-declare');
var rename = require('gulp-rename');
gulp.task('handlebars', function(){
gulp.src('ui/static/ui/templates/src/*.hbs')
.pipe(handlebars())
.pipe(defineModule('plain'))
.pipe(declare({
namespace: 'Handlebars.templates'
}))
.pipe(rename({ extname: '.js' }))
.pipe(uglify())
.pipe(gulp.dest('ui/static/ui/templates'));
});