私は次のgulpfile.jsを持っています
var gulp = require('gulp'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
bower = require('gulp-bower'),
通知 = 必須 ('gulp-notify'),
リロード = browserSync.reload、
bs = require("browser-sync").create(),
Hexo = require('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, {
サーバー: {
baseDir: "../../public"
}、
logLevel: 「デバッグ」
});
hexo.init();
hexo.call('生成', {}, 関数(){
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