Added PR feedback

This commit is contained in:
Neil MacDougall 2023-02-22 09:52:46 +00:00
parent c21d0c8a6b
commit 1f76ae125a
2 changed files with 13 additions and 9 deletions

View File

@ -102,15 +102,16 @@ gulp.task('bootstrap', function() {
.pipe(gulp.dest(VERSION_DIST)); .pipe(gulp.dest(VERSION_DIST));
}); });
gulp.task('livereload', function() { gulp.task('livereload', function(cb) {
gulp.watch('./gulpfile.js', ['server:reload']); gulp.watch('./gulpfile.js', gulp.series('server:reload'));
gulp.watch('styles/**', ['css']); gulp.watch('styles/**', gulp.series('css'));
gulp.watch('src/**', ['js']); gulp.watch('src/**', gulp.series('js'));
gulp.watch('templates/**', ['js']); gulp.watch('templates/**', gulp.series('js'));
gulp.watch('partials/**', ['js']); gulp.watch('partials/**', gulp.series('js'));
cb();
}) })
gulp.task('src', gulp.series('js','minjs','css','mincss','bootstrap')); gulp.task('src', gulp.series('minjs','mincss','bootstrap'));
gulp.task('tarball', gulp.series('src', function() { gulp.task('tarball', gulp.series('src', function() {
return gulp.src([VERSION_DIST+'/**'], {base: DIST}) return gulp.src([VERSION_DIST+'/**'], {base: DIST})
@ -119,10 +120,10 @@ gulp.task('tarball', gulp.series('src', function() {
.pipe(gulp.dest(DIST)); .pipe(gulp.dest(DIST));
})); }));
gulp.task('build', gulp.series('src', 'tarball'), () => {}); gulp.task('build', gulp.series('tarball'), () => {});
gulp.task('default', gulp.series('build')); gulp.task('default', gulp.series('build'));
gulp.task('server', gulp.series('build','livereload', function() { gulp.task('server', gulp.series('build', 'livereload', function() {
var cors = function(req, res, next) { var cors = function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Origin', '*');
next(); next();

View File

@ -13,6 +13,9 @@
"type": "git", "type": "git",
"url": "https://github.com/rancherio/api-ui.git" "url": "https://github.com/rancherio/api-ui.git"
}, },
"engine": {
"node": ">= 14.14"
},
"scripts": { "scripts": {
"start": "./node_modules/.bin/gulp server", "start": "./node_modules/.bin/gulp server",
"clean": "./node_modules/.bin/gulp clean", "clean": "./node_modules/.bin/gulp clean",