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

fix 404 errors on bower_components with Gulp on Windows #1316

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 13 additions & 2 deletions templates/common/root/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var lazypipe = require('lazypipe');
var rimraf = require('rimraf');
var wiredep = require('wiredep').stream;
var runSequence = require('run-sequence');
var st = require('st');

var yeoman = {
app: require('./bower.json').appPath || 'app',
Expand Down Expand Up @@ -89,7 +90,12 @@ 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, opt) {
return [
st({ path: 'bower_components', url: '/bower_components' })
];
}
});
});

Expand Down Expand Up @@ -136,7 +142,12 @@ gulp.task('serve:prod', function() {
$.connect.server({
root: [yeoman.dist],
livereload: true,
port: 9000
port: 9000,
middleware: function (connect, opt) {
return [
st({ path: 'bower_components', url: '/bower_components' })
];
}
});
});

Expand Down
3 changes: 2 additions & 1 deletion templates/common/root/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"grunt-wiredep": "^2.0.0",
"jit-grunt": "^0.9.1",
"time-grunt": "^1.0.0"<% } %>,
"jshint-stylish": "^1.0.0"
"jshint-stylish": "^1.0.0",
"st": "^1.1.0"
},
"engines": {
"node": ">=0.10.0"
Expand Down