-
Notifications
You must be signed in to change notification settings - Fork 18
/
gulpfile.js
55 lines (49 loc) · 1.22 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
47
48
49
50
51
52
53
54
55
var gulp = require( "gulp" ),
concat = require( "gulp-concat" ),
fileInclude = require( "gulp-file-include" ),
marked = require( "marked" ),
sass = require( "gulp-sass" ),
watch = require( "gulp-watch" ),
webServer = require( "gulp-webserver" );
gulp.task( "default", [ "build", "server" ], function() {
gulp.watch( "./src/**/*", [ "build" ]);
});
gulp.task( "build", [ "include", "sass", "scripts" ]);
gulp.task( "server", function() {
return gulp.src( "./" )
.pipe(webServer({
livereload: {
enable: true,
filter: function(fileName) {
return fileName.match(/index.html$/);
}
},
port: "3027",
open: "http://localhost:3027"
}));
});
gulp.task( "include", function() {
return gulp.src( "./src/index.html" )
.pipe( fileInclude({
prefix: "@@",
filters: {
markdown: marked
}
}))
.pipe( gulp.dest( "./" ) );
});
gulp.task( "sass", function () {
return gulp.src( "./src/scss/*.scss" )
.pipe( sass() )
.pipe( gulp.dest( "./css" ) );
});
gulp.task( "scripts", function() {
return gulp.src([
"src/scripts/fastclick.js",
"src/scripts/jquery.js",
"src/scripts/highlight.pack.js",
"src/scripts/app.js"
])
.pipe( concat( "built.js" ) )
.pipe( gulp.dest( "./scripts/" ) );
});