-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (45 loc) · 1.18 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
var gulp = require('gulp');
var gulpLoadPlugins = require('gulp-load-plugins');
var $ = gulpLoadPlugins({
scope: ['dependencies', 'devDependencies']
});
// Useful paths
var paths = {
'app-styles': ['app/sass/styles.scss'],
'app-all-styles': ['app/sass/**/*.scss'],
'app-css-out': 'app/css'
};
// Browsers we care about
var AUTOPREFIXER_BROWSERS = [
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
];
gulp.task('styles', function() {
// For best performance, don't add Sass partials to `gulp.src`
gulp.src(paths['app-styles'])
.pipe($.plumber())
.pipe($.changed('styles', {extension: '.scss'}))
.pipe($.sass({
precision: 10,
sourceComments: 'normal'
}))
.pipe($.autoprefixer({browsers: AUTOPREFIXER_BROWSERS}))
.pipe(gulp.dest(paths['app-css-out']));
// Concatenate And Minify Styles
//.pipe($.if('*.css', $.csso()))
//.pipe(gulp.dest('dist/styles'))
//.pipe($.size({title: 'styles'}));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
$.watch(paths['app-all-styles'], function () {
gulp.start('styles');
});
});