forked from AcroMedia/commerce_pos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (30 loc) · 850 Bytes
/
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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var config = {
'sassDirectories': [
{ src: './modules/label/sass/**/*.scss', dest: './modules/label/css'},
{ src: './sass/**/*.scss', dest: './css' }
]
};
gulp.task('sass', function() {
config.sassDirectories.map(function(dirInfo) {
gulp.src(dirInfo.src)
.pipe(sourcemaps.init())
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(dirInfo.dest))
});
});
gulp.task('sass:watch', function() {
config.sassDirectories.map(function(dirInfo) {
gulp.watch(dirInfo.src, ['sass']);
});
});
gulp.task('build', function() {
gulp.start(['sass']);
});
gulp.task('watch', function() {
gulp.start(['sass:watch']);
});