-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (56 loc) · 1.87 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'),
sass = require('gulp-ruby-sass'),
notify = require('gulp-notify'),
bower = require('gulp-bower'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
minify = require('gulp-minify'),
sourcemaps = require('gulp-sourcemaps');
var config = {
bowerDir: "./bower_components",
sassPath: "./static/scss",
staticPath: "./static"
};
gulp.task('bower', function() {
return bower()
.pipe(gulp.dest(config.bowerDir));
});
gulp.task('font-awesome', function() {
return gulp.src(config.bowerDir + "/font-awesome/fonts/**.*")
.pipe(gulp.dest(config.staticPath + "/fonts"));
});
gulp.task('css', function() {
return sass(config.sassPath + "/hip-styles.scss", {
sourcemap: true,
style: 'compressed',
loadPath: [
config.bowerDir + "/bootstrap-sass/assets/stylesheets",
config.bowerDir + "/font-awesome/scss",
]
}).on("error", notify.onError(function(error) {
return "Error: " + error.message;
}))
.pipe(sourcemaps.write())
.pipe(sourcemaps.write('maps', {
includeContent: false,
sourceRoot: 'source'
}))
.pipe(gulp.dest(config.staticPath + "/css"));
});
gulp.task('js', function() {
gulp.src(config.staticPath + "/js/base/**/*.js")
.pipe(concat('site.js'))
.pipe(gulp.dest(config.staticPath + "/js"))
.pipe(rename('site.js'))
.pipe(minify({
ext:{
min:".min.js"
}
}))
.pipe(gulp.dest(config.staticPath + "/js"));
});
gulp.task('watch', function() {
gulp.watch(config.sassPath + "/**/*.scss", ['css']);
gulp.watch(config.staticPath + "/js/base/**/*.js", ['js']);
});
gulp.task('default', ['bower', 'font-awesome', 'css']);