-
Notifications
You must be signed in to change notification settings - Fork 1.4k
confusion with dir for bower components #1345
Comments
@FelicePollano I ran into the same problem. In comparing the grunt build to the gulp, I've come up with a working solution to get the app serving with Note: I've not yet tested the test, dist, prod tasks with the below changes. Update 1: Change the start:server task to the followinggulp.task('start:server', function() {
$.connect.server({
root: [yeoman.app, '.tmp'],
livereload: true,
// Change this to '0.0.0.0' to access the server from outside.
port: 9000,
middleware: function (connect) {
return [
connect().use(
'/bower_components',
connect.static('./bower_components')
)]
}
});
}); Update 2: Change the server task to the followinggulp.task('serve', function (cb) {
runSequence('clean:tmp',
['lint:scripts'],
['start:client'],
['bower'],
'watch', cb);
}); Update 3: Change the bower task to the followinggulp.task('bower', function () {
return gulp.src(paths.views.main)
.pipe(wiredep({
ignorePath: '..'
}))
.pipe(gulp.dest(yeoman.app + '/'));
}); |
Solution works for me 👍 When running dist it did not copy the fonts from Bootstrap one of my choosen options when generaton ran, so I did a small hack which sure needs to be adapted to other needs Copy bootstrap fonts to "dist" folder
Other thing, index.html in dist gets a number prefixed to the name something like index-b9577afaf1.html I was unable to find where it happens, need to read more but but for now I can live with that :) |
I solved the index.html revision issue with the following modifications @@ -1,6 +1,7 @@
gulp.task('client:build', ['html', 'styles'], function () {
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
+ var indexHtmlFilter = $.filter(['**/*', '!**/index.html'], { restore: true });
return gulp.src(paths.views.main)
.pipe($.useref({searchPath: [yeoman.app, '.tmp']}))
@@ -11,7 +12,9 @@ gulp.task('client:build', ['html', 'styles'], function () {
.pipe(cssFilter)
.pipe($.minifyCss({cache: true}))
.pipe(cssFilter.restore())
+ .pipe(indexHtmlFilter)
.pipe($.rev())
+ .pipe(indexHtmlFilter.restore())
.pipe($.revReplace())
.pipe(gulp.dest(yeoman.dist));
}); |
from other thread, the bower_components folder has moved outside the app folder. Unfortunately this break the gulp 'bower' task: by the way the task is not called correctly by the principal generator, it search for a gulp task called 'wiredep' instead of 'bower' ( as I understood..).
In any case is not clear how to have the app properly scaffolded.
The text was updated successfully, but these errors were encountered: