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
42
webui/gulp/inject.js
Normal file
42
webui/gulp/inject.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var gulp = require('gulp');
|
||||
var conf = require('./conf');
|
||||
|
||||
var $ = require('gulp-load-plugins')();
|
||||
|
||||
var wiredep = require('wiredep').stream;
|
||||
var _ = require('lodash');
|
||||
|
||||
var browserSync = require('browser-sync');
|
||||
|
||||
gulp.task('inject-reload', ['inject'], function() {
|
||||
browserSync.reload();
|
||||
});
|
||||
|
||||
gulp.task('inject', ['scripts', 'styles'], function () {
|
||||
var injectStyles = gulp.src([
|
||||
path.join(conf.paths.tmp, '/serve/app/**/*.css'),
|
||||
path.join('!' + conf.paths.tmp, '/serve/app/vendor.css')
|
||||
], { read: false });
|
||||
|
||||
var injectScripts = gulp.src([
|
||||
path.join(conf.paths.src, '/app/**/*.module.js'),
|
||||
path.join(conf.paths.src, '/app/**/*.js'),
|
||||
path.join('!' + conf.paths.src, '/app/**/*.spec.js'),
|
||||
path.join('!' + conf.paths.src, '/app/**/*.mock.js'),
|
||||
])
|
||||
.pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort'));
|
||||
|
||||
var injectOptions = {
|
||||
ignorePath: [conf.paths.src, path.join(conf.paths.tmp, '/serve')],
|
||||
addRootSlash: false
|
||||
};
|
||||
|
||||
return gulp.src(path.join(conf.paths.src, '/*.html'))
|
||||
.pipe($.inject(injectStyles, injectOptions))
|
||||
.pipe($.inject(injectScripts, injectOptions))
|
||||
.pipe(wiredep(_.extend({}, conf.wiredep)))
|
||||
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve')));
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue