Open robbiemu opened 7 years ago
So I got it working this morning.
Things I did.
var clean = require('gulp-clean');
gulp.task('clean', function () {
return gulp.src('build/*', {read: false})
.pipe(clean());
})
gulp default
won't rebuild build directory:gulp.task('default', function () {
gulp.start('clean', 'html', 'templates', 'css', 'sass', 'scripts')
Those two are unnecessary but it made it easy to see why it wasn't working.
reload()
to: reload({stream:true})
What I didn't do: follow the advise elsewhere in this issue tracker from a third party to change the server init. It works fine just like it is.
The gist I posted has a final version posted now, so you can see the changes all in one place.
Thank you for finding the bug and suggesting how to fix that
I'll change all reload()
to reload({stream:true})
first
and after that, maybe I'll think of making task clean
as you suggested
https://gist.github.com/robbiemu/5deda56a87047e4348a45920fa48c1bd
And you can change the source code and make pull request, if you want. Actually it's really easy to change, maybe you can fix the problem only by updating index.html without rewriting some js codes. cuz, gulp-generator has been created by template engine called "aTemplate"
I'm trying to use this with the browserSync options, Im not sure if I am doing something wrong. I .. guess I must be. Honestly, this is not entirely a vanilla generated file — I edited it to added scss and sass extensions, and to use the root directory of
dev
as well as a subdirectory for sources for html. The complete gulpfile is at this gist. I getI read that you can wrap the reload function is an outer function to call it, or pass
{stream: true}
I think it was, but these either failed or caused it to trigger that message over and over again.My project structure is:
./build - build testing output directory/page root ./dev - source files
generated browseSync in default task:
I can see all my code is generated in build: the index.html is sitting right where it should at './build/index.html'... The browser fires up automatically. — but to a blank page that just says "Cannot GET /" (changing the url to point specifically to /index.html or /build/index.html also doesn't work).
The logs though, look like it should work just fine.
I also notice that you don't generate a hashcode for the configuration options that were chosen, so you can't recreate the initial file easily. You might consider adding that for your own benefit. ☺