-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 lines (50 loc) · 1.46 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'),
path = require('path'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps');
var paths = {
jslibs: [
'node_modules/angular/angular.min.js',
'node_modules/angular-resource/angular-resource.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/jquery/dist/jquery.min.js'
],
styles: [
'node_modules/bootstrap/dist/css/bootstrap.min.css'
],
fonts: [
'node_modules/bootstrap/fonts/**/*'
],
dest: {
scripts: path.join(__dirname, 'static', 'scripts'),
styles: path.join(__dirname, 'static', 'styles')
},
scss: {
source: path.join(__dirname, 'source', 'scss/**/*.scss')
}
}
var sass_error_handler = function(err) {
console.log(err);
};
gulp.task('copy-styles', function() {
gulp.src(paths.styles)
.pipe(gulp.dest(path.join(paths.dest.styles, 'css')));
gulp.src(paths.fonts)
.pipe(gulp.dest(path.join(paths.dest.styles, 'fonts')));
});
gulp.task('copy-scripts', function() {
gulp.src(paths.jslibs)
.pipe(gulp.dest(paths.dest.scripts));
});
gulp.task('sass', function() {
gulp.src(paths.scss.source)
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass_error_handler))
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.join(paths.dest.styles, 'css')));
});
gulp.task('sass:watch', function() {
gulp.watch(paths.scss.source, ['sass']);
});
gulp.task('default', ['copy-scripts', 'copy-styles', 'sass'])