aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/gulp/styles.js
blob: 9f4c4c35d3c25f924074b70daa7e6b0b7ce7eeed (plain)
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
var path = require('path');

var gulp = require('gulp');
var gulpif = require('gulp-if');
var less = require('gulp-less');
var nano = require('gulp-cssnano');
var autoprefixer = require('gulp-autoprefixer');


var nanoOptions = {
  discardComments: { removeAll: true }
};

var autoprefixerOptions = {
  browsers: [
    'last 3 Chrome versions',
    'last 3 Firefox versions',
    'Safari >= 8',
    'Edge >= 12',
    'IE 11'
  ]
};


module.exports.styles = function (output, production) {
  return gulp.src(['src/main/less/sonar.less'])
      .pipe(less())
      .pipe(autoprefixer(autoprefixerOptions))
      .pipe(gulpif(production, nano(nanoOptions)))
      .pipe(gulp.dest(path.join(output, 'css')));
};