blob: 69c4c700cb762162738991f447e3d50af83acd1a [file] [log] [blame]
Steven Burrowsa145e102017-06-16 13:37:50 -04001import gulp from 'gulp';
2import concat from 'gulp-concat';
3import BundleResources from '../helpers/bundleResources';
Steven Burrows1270c182017-09-14 10:14:58 +01004import { reload } from '../../dev-server';
Steven Burrowsa145e102017-06-16 13:37:50 -04005
6const GUI_BASE = '../../web/gui/src/main/webapp/';
7const bundleFiles = [
8 'app/onos.css',
9 'app/onos-theme.css',
10 'app/common.css',
11 'app/fw/**/*.css',
12 'app/view/**/*.css',
13];
14
Steven Burrows1270c182017-09-14 10:14:58 +010015const task = () => {
Steven Burrowsa145e102017-06-16 13:37:50 -040016
Steven Burrows1270c182017-09-14 10:14:58 +010017 gulp.task('bundle-css', function () {
18 return gulp.src(BundleResources(GUI_BASE, bundleFiles))
19 .pipe(concat('onos.css'))
20 .pipe(gulp.dest(GUI_BASE + '/dist/'))
21 .on('end', () => { reload(); });
22 });
23
24 gulp.task('watch-css', () => {
25 gulp.watch([GUI_BASE + 'app/**/*.css'], ['bundle-css']);
26 });
27}
28
29export default task();