-
Notifications
You must be signed in to change notification settings - Fork 14
/
gulpfile.js
54 lines (44 loc) · 1.07 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
/* gulpfile.js */
var
gulp = require('gulp'),
sass = require('gulp-sass');
// source and distribution folder
var
source = 'src/',
dest = 'dist/';
// Bootstrap scss source
var bootstrapSass = {
in: './node_modules/bootstrap-sass/'
};
// fonts
var fonts = {
in: [source + 'fonts/*.*', bootstrapSass.in + 'assets/fonts/**/*'],
out: dest + 'fonts/'
};
// css source file: .scss files
var css = {
in: source + 'scss/main.scss',
out: dest + 'css/',
watch: source + 'scss/**/*',
sassOpts: {
outputStyle: 'nested',
precision: 8,
errLogToConsole: true,
includePaths: [bootstrapSass.in + 'assets/stylesheets']
}
};
gulp.task('fonts', function () {
return gulp
.src(fonts.in)
.pipe(gulp.dest(fonts.out));
});
// compile scss
gulp.task('sass', ['fonts'], function () {
return gulp.src(css.in)
.pipe(sass(css.sassOpts))
.pipe(gulp.dest(css.out));
});
// default task
gulp.task('default', ['sass'], function () {
gulp.watch(css.watch, ['sass']);
});