简体   繁体   English

Gulp 说实时重新加载正在重新加载但浏览器没有?

[英]Gulp says live reload is reloading but browser doesn't?

Here's the log in the terminal:这是终端中的日志:

[10:12:09] Using gulpfile ~/somelocalpath/gulpfile.js
[10:12:09] Starting 'watch'...
[10:12:09] Starting server...
[10:12:09] Finished 'watch' after 21 ms
[10:12:09] Server started http://localhost:8888
[10:12:09] LiveReload started on port 35729
[10:12:09] Running server
[10:12:47] Starting 'reload'...
[10:12:47] Finished 'reload' after 13 ms
[10:13:43] Starting 'reload'...
[10:13:43] Finished 'reload' after 1.75 ms

Here's the gulp.js file:这是 gulp.js 文件:

"use strict";

const gulp = require("gulp");
const connect = require("gulp-connect");

gulp.task("watch", function() {
    connect.server({
        root: "somelocalfolder",
        livereload: true,
        port: 8888
    });
    gulp.watch("./somelocalfolder/**/*", ["reload"]);
});
gulp.task("reload", function() {
    return gulp.src("./somelocalfolder/**/*").pipe(connect.reload());
});

But the browser doesn't automatically reload?但是浏览器不会自动重新加载?

您的浏览器中是否安装了扩展程序?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM