Steven Burrows | a145e10 | 2017-06-16 13:37:50 -0400 | [diff] [blame] | 1 | import gulp from 'gulp'; |
| 2 | import concat from 'gulp-concat'; |
| 3 | import BundleResources from '../helpers/bundleResources'; |
Steven Burrows | 1270c18 | 2017-09-14 10:14:58 +0100 | [diff] [blame] | 4 | import { reload } from '../../dev-server'; |
Steven Burrows | a145e10 | 2017-06-16 13:37:50 -0400 | [diff] [blame] | 5 | |
| 6 | const GUI_BASE = '../../web/gui/src/main/webapp/'; |
| 7 | const 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 Burrows | 1270c18 | 2017-09-14 10:14:58 +0100 | [diff] [blame] | 15 | const task = () => { |
Steven Burrows | a145e10 | 2017-06-16 13:37:50 -0400 | [diff] [blame] | 16 | |
Steven Burrows | 1270c18 | 2017-09-14 10:14:58 +0100 | [diff] [blame] | 17 | 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 | |
| 29 | export default task(); |