我有以下 gulpfile.js
var gulp = 需要('gulp'),
browserSync = require('浏览器同步'),
sass = require('gulp-sass'),
bower = require('gulp-bower'),
notify = require('gulp-notify'),
重载 = browserSync.reload,
bs = require("浏览器同步").create(),
Hexo = 要求('hexo'),
hexo = new Hexo(process.cwd(), {});
var src = {
scss: './scss/',
css: './source/css',
ejs:'布局'
},
监视文件 = [
'./scss/*.scss',
'*/*.ejs'
];
// 静态服务器 + 看 scss/html 文件
gulp.task('serve', ['sass:watch'], function() {
// init 启动服务器
bs.init(watchFiles, {
服务器: {
基础目录:“../../public”
},
日志级别:“调试”
});
hexo.init();
hexo.call('generate', {}, function(){
console.log('已启动 Hexo 服务器');
})
});
如何在 gulpfile 中的手表中启动 hexo?
gulpfile 的其余部分在这里:
https://github.com/chrisjlee/hexo-theme-zurb-foundation/blob/master/gulpfile.js
hexo 索引文件在这里接受参数;但我无法弄清楚这些论点;
https://github.com/hexojs/hexo/blob/master/lib/hexo/index.js