From 2f7ed516a2aeec8223b797c1523204d4fb29c3c5 Mon Sep 17 00:00:00 2001 From: Yohannes Tamru Date: Thu, 8 Jun 2017 18:13:02 +0300 Subject: [PATCH] fix bower_component loading problem on _gulpfile template --- templates/common/root/_gulpfile.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/templates/common/root/_gulpfile.js b/templates/common/root/_gulpfile.js index 8e6783ee9..9bda49ca2 100644 --- a/templates/common/root/_gulpfile.js +++ b/templates/common/root/_gulpfile.js @@ -89,7 +89,10 @@ gulp.task('start:server', function() { root: [yeoman.app, '.tmp'], livereload: true, // Change this to '0.0.0.0' to access the server from outside. - port: 9000 + port: 9000, + middleware: function (connect) { + return [connect().use('/bower_components', connect.static('bower_components'))]; + } }); }); @@ -97,7 +100,10 @@ gulp.task('start:server:test', function() { $.connect.server({ root: ['test', yeoman.app, '.tmp'], livereload: true, - port: 9001 + port: 9001, + middleware: function (connect) { + return [connect().use('/bower_components', connect.static('bower_components'))]; + } }); }); @@ -107,6 +113,10 @@ gulp.task('watch', function () { .pipe(styles()) .pipe($.connect.reload()); + $.watch(paths.views.main) + .pipe($.plumber()) + .pipe($.connect.reload()); + $.watch(paths.views.files) .pipe($.plumber()) .pipe($.connect.reload()); @@ -153,10 +163,10 @@ gulp.task('test', ['start:server:test'], function () { gulp.task('bower', function () { return gulp.src(paths.views.main) .pipe(wiredep({ - directory: yeoman.app + '/bower_components', + directory: 'bower_components', ignorePath: '..' })) - .pipe(gulp.dest(yeoman.app + '/views')); + .pipe(gulp.dest(yeoman.app)); }); ///////////