forked from makotokw/redmine-theme-gitmike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (47 loc) · 1.3 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
/*jshint node: true */
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var reload = browserSync.reload;
function compass(env) {
gulp.src('./sass/*.scss')
.pipe(plugins.compass({
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(plugins.autoprefixer({
cascade: false
}))
.pipe(gulp.dest('stylesheets'))
.pipe(reload({stream: true, once: true}));
}
gulp.task('compass', function () {
compass('production');
});
gulp.task('compass:dev', function () {
compass('development');
});
gulp.task('browser-sync', function () {
browserSync({
port: 3001,
proxy: "127.0.0.1:3000"
});
});
gulp.task('browser-sync:reload', function () {
browserSync.reload();
});
gulp.task('debug', ['compass:dev', 'browser-sync'],
function () {
gulp.watch('sass/**/*.scss', ['compass:dev']);
}
);
gulp.task('default', ['compass']);