feat: new Web UI build system
- use generator-gulp-angular by @swiip - remove old static file
This commit is contained in:
parent
587b17c120
commit
b7a71edfcb
83 changed files with 1069 additions and 1028 deletions
39
webui/gulp/watch.js
Normal file
39
webui/gulp/watch.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var gulp = require('gulp');
|
||||
var conf = require('./conf');
|
||||
|
||||
var browserSync = require('browser-sync');
|
||||
|
||||
function isOnlyChange(event) {
|
||||
return event.type === 'changed';
|
||||
}
|
||||
|
||||
gulp.task('watch', ['inject'], function () {
|
||||
|
||||
gulp.watch([path.join(conf.paths.src, '/*.html'), 'bower.json'], ['inject-reload']);
|
||||
|
||||
gulp.watch([
|
||||
path.join(conf.paths.src, '/app/**/*.css'),
|
||||
path.join(conf.paths.src, '/app/**/*.scss')
|
||||
], function(event) {
|
||||
if(isOnlyChange(event)) {
|
||||
gulp.start('styles-reload');
|
||||
} else {
|
||||
gulp.start('inject-reload');
|
||||
}
|
||||
});
|
||||
|
||||
gulp.watch(path.join(conf.paths.src, '/app/**/*.js'), function(event) {
|
||||
if(isOnlyChange(event)) {
|
||||
gulp.start('scripts-reload');
|
||||
} else {
|
||||
gulp.start('inject-reload');
|
||||
}
|
||||
});
|
||||
|
||||
gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) {
|
||||
browserSync.reload(event.path);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue