-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
57 lines (49 loc) · 1.33 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var notify = require('gulp-notify');
var bower = require('gulp-bower');
var autoprefixer = require('gulp-autoprefixer');
var zip = require('gulp-zip');
var config = {
scssDir: 'assets/scss',
bowerDir: 'bower_components'
}
gulp.task('bower', function(){
return bower()
.pipe(gulp.dest(config.bowerDir))
});
gulp.task('sass', function() {
gulp.src(config.scssDir + '/**/*.scss')
.pipe(
sass({
includePaths: [
config.scssDir,
config.bowerDir + "/bourbon/app/assets/stylesheets",
config.bowerDir + "/neat/app/assets/stylesheets",
]
}).on('error', notify.onError(function(error){
return "Error: " + error.message;
})))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('./assets/css'));
});
gulp.task('sass:watch', function() {
gulp.watch(config.scssDir + '/**/*.scss', ['sass']);
});
gulp.task('build:zip', function() {
gulp.src([
"./**/*",
'!Gulpfule.js',
'!./assets/scss/**/*',
'!./bower_components/**/*',
'!./dist/**/*',
'!./node_modules/**/*'
])
.pipe(zip('theme.zip'))
.pipe(gulp.dest("dist"))
});
gulp.task('build', ['bower', 'sass', 'build:zip']);
gulp.task('dev',['bower', 'sass:watch']);