forked from makotokw/redmine-theme-gitmike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (43 loc) · 1.28 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
'use strict';
var gulp = require('gulp');
var gulpCompass = require('gulp-compass');
var gulpAutoPrefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
function compass(env) {
return gulp.src('./sass/*.scss')
.pipe(gulpCompass({
config_file: 'sass/config.rb',
environment: env,
comments: env === 'development',
style: env === 'development' ? 'expanded' : 'compact',
css: 'stylesheets',
sass: 'sass',
force: env !== 'development'
}))
.on('error', function (err) {
console.log(err);
})
.pipe(gulpAutoPrefixer({
cascade: false
}))
.pipe(gulp.dest('stylesheets'))
.pipe(browserSync.stream())
;
}
gulp.task('compass:prod', function () {
return compass('production');
});
gulp.task('compass:dev', function () {
return compass('development');
});
gulp.task('browser-sync', function (done) {
browserSync.init({
port: 3001,
proxy: '127.0.0.1:3000'
});
done();
});
gulp.task('debug', gulp.series('compass:dev', 'browser-sync', function () {
gulp.watch('sass/**/*.scss', gulp.task('compass:dev'));
}));
gulp.task('default', gulp.series('compass:prod'));