I just returned to this, and since last summer the situation has improved significantly. I made a gulpfile based on this for the Polymer Starter Kit (1.2.3). But I changed the behavior of the task defaultand serveto run the Jekyll and assembly in the shell:
var spawn = require('child_process').spawn;
var argv = require('yargs').argv;
gulp.task('jekyllbuild', function(done) {
return spawn('bundle', ['exec', 'jekyll', 'build'], { stdio: 'inherit' })
.on('close', done);
});
gulp.task('default', ['clean'], function(cb) {
runSequence(
'jekyllbuild',
['ensureFiles', 'copy', 'styles'],
'elements',
['images', 'fonts', 'html'],
'vulcanize',
cb);
});
gulp.task('serve', function(done) {
if (argv.port) {
return spawn('bundle', ['exec', 'jekyll', 'serve', '--port=' + argv.port], { stdio: 'inherit' })
.on('close', done);
} else {
return spawn('bundle', ['exec', 'jekyll', 'serve'], { stdio: 'inherit' })
.on('close', done);
}
});
Using BrowserSync will have a much cleaner effect, but it's an easy way to get Jekyll functionality and the benefits of vulcanization for production. (Note that you also need to install the package yargsto handle the port specification.) All my gulpfile is here .
source
share