-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
63 lines (46 loc) · 1.54 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
56
57
58
59
60
61
62
63
var gulp = require('gulp');
var slim = require("gulp-slim");
var rename = require("gulp-rename");
var sass = require('gulp-sass');
gulp.task('default', ['slim', 'move_images', 'move_icons', 'move_bower', 'compile_scss', 'move_js', 'move_other_files', 'watch']);
gulp.task('slim', function(){
gulp.src("./source/**/[^_]*.slim")
.pipe(slim({ chdir: true, pretty: true, include: true }))
.pipe(rename(function (file) {
if((file.basename === 'index') && (file.dirname === 'layouts')){
file.basename = 'index';
}else{
file.basename = file.dirname + '_' + file.basename;
}
file.dirname = '.';
}))
.pipe(gulp.dest("./dist/"));
});
gulp.task('move_icons', function(){
gulp.src("./source/icon_fonts_assets/**/*")
.pipe(gulp.dest("./dist/icon_fonts_assets/"));
});
gulp.task('move_images', function(){
gulp.src("./source/img/**/*")
.pipe(gulp.dest("./dist/img/"));
});
gulp.task('move_js', function(){
gulp.src("./source/js/**/*")
.pipe(gulp.dest("./dist/js/"));
});
gulp.task('move_bower', function(){
gulp.src("./source/bower_components/**/*")
.pipe(gulp.dest("./dist/bower_components/"));
});
gulp.task('compile_scss', function(){
gulp.src("./source/scss/**/main.scss")
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest("./dist/css/"));
});
gulp.task('watch', function () {
//gulp.watch('./source/scss/**/*.scss', ['compile_scss']);
});
gulp.task('move_other_files', function(){
gulp.src(["./source/*.html", "./source/*.png"])
.pipe(gulp.dest("./dist/"));
});