每当我运行 Gulp 命令将本地服务器启动到 localhost3000 时,它似乎在终端中运行,但它从未在浏览器中完全连接。装载轮不停地旋转。下面是应该启动服务器的 Gulp 命令。
// ### Watch
// `gulp watch` - Use BrowserSync to proxy your dev server and synchronize code
// changes across devices. Specify the hostname of your dev server at
// `manifest.config.devUrl`. When a modification is made to an asset, run the
// build step for that asset and inject the changes into the page.
// See: http://www.browsersync.io
gulp.task("watch", function () {
browserSync.init({
files: ["{lib,templates}/**/*.php", "*.php"],
proxy: config.devUrl,
snippetOptions: {
whitelist: ["/wp-admin/admin-ajax.php"],
blacklist: ["/wp-admin/**"],
},
});
gulp.watch([path.source + "styles/**/*"], ["styles"]);
gulp.watch([path.source + "scripts/**/*"], ["jshint", "scripts"]);
gulp.watch([path.source + "fonts/**/*"], ["fonts"]);
gulp.watch([path.source + "images/**/*"], ["images"]);
gulp.watch(["bower.json", "assets/manifest.json"], ["build"]);
});