Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

fix bower_component loading problem on _gulpfile template #1408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions templates/common/root/_gulpfile.js
Original file line number Diff line number Diff line change
@@ -89,15 +89,21 @@ 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'))];
}
});
});

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));
});

///////////