Gulp + BrowserSync 启动 localhost:3000 但从未完全加载/连接

问题描述 投票:0回答:0

每当我运行 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"]);
});
wordpress gulp browser-sync gulp-watch gulp-browser-sync
© www.soinside.com 2019 - 2024. All rights reserved.