1
我有一個基本的gulp.js設置在我的wordpress環境中運行。除了我重新加載更改後的.php文件的方式外,一切都可以運行。當gulp完成運行任務時,似乎要加載任務兩次,這意味着它將開始 - 完成任務,然後再次重新運行任務。我一直在觀看的文件位於根目錄以及庫目錄中。另外,有沒有辦法讓大家只查找更改過的文件。我有這樣設置:Gulp Refresh WordPress的PHP文件
// PHP TASK
gulp.task(‘php’, function() {
watch({glob:['.php','library/.php']})
.pipe(plugins.livereload(server))
.pipe(plugins.notify({ message: ‘PHP task complete’ }));
});
// Watch
gulp.task(‘watch’, function() {
// Listen on port 35729
server.listen(35729, function (err) {
if (err) {
return console.log(err)
};
// Watch php files
gulp.watch(['php']);
});
});
// Default task
gulp.task(‘default’, ['php', 'watch']);
=================================== =
這是一次保存的結果。
[gulp] index.php was reloaded.
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
[gulp] index.php was reloaded.
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …
… Reload /Users/jfearing/Sites/zurb/wp-content/themes/JointsWP-CSS-master/index.php …