-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.js
More file actions
46 lines (36 loc) · 1.15 KB
/
Gulpfile.js
File metadata and controls
46 lines (36 loc) · 1.15 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
var gulp=require("gulp"),
connect=require("gulp-connect"),
sass=require("gulp-sass"),
open=require("gulp-open"),
handlebars = require('handlebars'),
gulpHandlebars = require('gulp-compile-handlebars')(handlebars),
rename = require('gulp-rename');
gulp.task('handlebars', function () {
var templateData = 'modules/**/data/*.json',
options = {
partialsDirectory : ['modules/partials/**']
}
return gulp.src('modules/**/*.hbs')
.pipe(rename('**/*.html'))
.pipe(gulp.dest('dist'));
});
gulp.task("server",function(){
connect.server({
port:8888,
livereload:true
});
});
gulp.task("open",function(){
gulp.src(__filename).pipe(open({uri:"http://localhost:8888/gallery.html"}));
});
gulp.task("html",function(){
gulp.src('index.html').pipe(connect.reload());
});
gulp.task("sass",function(){
console.info("main.scss changed");
return gulp.src("scss/main.scss").pipe(sass().on('error',sass.logError)).pipe(gulp.dest("./css"));
});
gulp.task("watch",function(){
gulp.watch(['*.html',"scss/*.scss"],['sass','html']);
});
gulp.task("default",["server","watch", "open"]);