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
|
var path = require('path');
var gulp = require('gulp');
var concat = require('gulp-concat');
var gulpif = require('gulp-if');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
module.exports.styles = function (output, production, dev) {
return gulp.src([
'src/main/less/jquery-ui.less',
'src/main/less/select2.less',
'src/main/less/select2-sonar.less',
'src/main/less/init.less',
'src/main/less/components.less',
'src/main/less/pages.less',
'src/main/less/style.less',
'src/main/less/*.less'
])
.pipe(gulpif(dev, sourcemaps.init()))
.pipe(less())
.pipe(autoprefixer({
browsers: [
'last 3 Chrome versions',
'last 3 Firefox versions',
'Safari >= 8',
'Edge >= 12',
'IE 11'
]
}))
.pipe(gulpif(production, minifyCss()))
.pipe(concat('sonar.css'))
.pipe(gulpif(dev, sourcemaps.write({ includeContent: true })))
.pipe(gulp.dest(path.join(output, 'css')));
};
|