1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/gulp/less.js

52 lines
1.8 KiB
JavaScript
Raw Normal View History

2014-08-29 00:40:18 +03:00
var gulp = require('gulp');
2014-08-29 00:40:18 +03:00
var less = require('gulp-less');
var postcss = require('gulp-postcss');
2015-08-11 19:44:05 +02:00
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('autoprefixer-core');
2015-07-22 04:38:46 +02:00
var livereload = require('gulp-livereload');
2017-04-29 11:49:37 +02:00
var cleancss = require('gulp-clean-css');
var print = require('gulp-print');
2014-08-29 00:40:18 +03:00
var paths = require('./paths');
2014-08-30 08:59:08 +03:00
var errorHandler = require('./errorHandler');
2014-08-29 00:40:18 +03:00
2015-07-22 04:42:38 +02:00
gulp.task('less', function() {
var src = [
paths.src.content + 'bootstrap.less',
paths.src.content + 'theme.less',
paths.src.content + 'overrides.less',
2017-04-29 02:47:13 +02:00
paths.src.content + 'bootstrap.toggle-switch.css',
paths.src.content + 'fullcalendar.css',
paths.src.content + 'Messenger/messenger.css',
paths.src.content + 'Messenger/messenger.flat.css',
2015-07-22 04:42:38 +02:00
paths.src.root + 'Series/series.less',
paths.src.root + 'Activity/activity.less',
paths.src.root + 'AddSeries/addSeries.less',
paths.src.root + 'Calendar/calendar.less',
paths.src.root + 'Cells/cells.less',
paths.src.root + 'ManualImport/manualimport.less',
paths.src.root + 'Settings/settings.less',
paths.src.root + 'System/Logs/logs.less',
paths.src.root + 'System/Update/update.less',
2015-07-28 07:34:44 +02:00
paths.src.root + 'System/Info/info.less'
2015-07-22 04:42:38 +02:00
];
return gulp.src(src)
2014-08-29 00:40:18 +03:00
.pipe(print())
2015-08-11 19:44:05 +02:00
.pipe(sourcemaps.init())
2014-08-29 00:40:18 +03:00
.pipe(less({
2015-07-22 04:42:38 +02:00
dumpLineNumbers : 'false',
2017-04-29 11:49:37 +02:00
compress : false,
yuicompress : false,
2015-07-22 04:42:38 +02:00
ieCompat : true,
strictImports : true
2014-08-29 00:40:18 +03:00
}))
.pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }) ]))
2017-04-29 11:49:37 +02:00
.pipe(cleancss())
2014-08-30 08:59:08 +03:00
.on('error', errorHandler.onError)
.pipe(sourcemaps.write(paths.dest.content))
2015-07-22 04:38:46 +02:00
.pipe(gulp.dest(paths.dest.content))
.pipe(livereload());
});