sonarr-repo-only/gulp/less.js

63 lines
2.2 KiB
JavaScript
Raw Normal View History

2014-08-28 21:40:18 +00:00
var gulp = require('gulp');
var less = require('gulp-less');
2015-08-11 17:44:05 +00:00
var sourcemaps = require('gulp-sourcemaps');
2014-08-28 21:40:18 +00:00
var print = require('gulp-print');
2015-07-22 02:42:38 +00:00
var phantom = require('./phantom');
2015-07-22 02:38:46 +00:00
var livereload = require('gulp-livereload');
2014-08-28 21:40:18 +00:00
var paths = require('./paths');
2014-08-30 05:59:08 +00:00
var errorHandler = require('./errorHandler');
2014-08-28 21:40:18 +00:00
2015-07-22 02:42:38 +00:00
gulp.task('less', function() {
var src = [
paths.src.content + 'bootstrap.less',
paths.src.content + 'theme.less',
paths.src.content + 'overrides.less',
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 05:34:44 +00:00
paths.src.root + 'System/Info/info.less'
2015-07-22 02:42:38 +00:00
];
if (phantom) {
src = [
2014-08-28 21:40:18 +00:00
paths.src.content + 'bootstrap.less',
2015-07-22 02:42:38 +00:00
paths.src.content + 'angle.less',
paths.src.content + 'sonarr.less',
2014-08-28 21:40:18 +00:00
paths.src.content + 'overrides.less',
paths.src.root + 'Series/series.less',
2014-10-12 17:21:40 +00:00
paths.src.root + 'Activity/activity.less',
2015-08-11 17:44:05 +00:00
paths.src.root + 'AddSeries/AddSeries.less',
2014-08-28 21:40:18 +00:00
paths.src.root + 'Calendar/calendar.less',
paths.src.root + 'Cells/cells.less',
2015-03-04 00:42:37 +00:00
paths.src.root + 'ManualImport/manualimport.less',
2014-08-28 21:40:18 +00:00
paths.src.root + 'Settings/settings.less',
paths.src.root + 'System/Logs/logs.less',
paths.src.root + 'System/Update/update.less',
2015-07-28 05:34:44 +00:00
paths.src.root + 'System/Info/info.less'
];
2015-07-22 02:42:38 +00:00
}
return gulp.src(src)
2014-08-28 21:40:18 +00:00
.pipe(print())
2015-08-11 17:44:05 +00:00
.pipe(sourcemaps.init())
2014-08-28 21:40:18 +00:00
.pipe(less({
2015-07-22 02:42:38 +00:00
dumpLineNumbers : 'false',
compress : true,
yuicompress : true,
ieCompat : true,
strictImports : true
2014-08-28 21:40:18 +00:00
}))
2014-08-30 05:59:08 +00:00
.on('error', errorHandler.onError)
2015-08-11 17:44:05 +00:00
.pipe(sourcemaps.write())
2015-07-22 02:38:46 +00:00
.pipe(gulp.dest(paths.dest.content))
.pipe(livereload());
});