Gulp.watch refreshes my browser one time, but then not againGet the size of the screen, current web page and browser windowHow can I refresh a page with jQuery?How to combine gulp-watch and gulp-inject?Start hexo to generate a watch in a gulpfile.js?Gulp-sass won't compile scss files to css instead copy all files from scss folder to css folderbrowser not refreshed on gulp + browser sync + vim stackgulp with less and browser-syncHave to run gulp more than once to get Style changesBrowser-Sync - All events Hook - GulpBrowserSync not working running through gulpfile.js

Cayley's Matrix Notation

Nails holding drywall

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

A Paper Record is What I Hamper

Why is the underscore command _ useful?

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?

How to have a sharp product image?

Drawing a german abacus as in the books of Adam Ries

Is Diceware more secure than a long passphrase?

How to not starve gigantic beasts

How important is it that $TERM is correct?

What makes accurate emulation of old systems a difficult task?

What is the best way to deal with NPC-NPC combat?

Which big number is bigger?

Mistake in years of experience in resume?

Can someone publish a story that happened to you?

Injection into a proper class and choice without regularity

Combinatorics problem, right solution?

What was Apollo 13's "Little Jolt" after MECO?

An array in a equation with curly braces in both sides

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

Does a large simulator bay have standard public address announcements?

Is Electric Central Heating worth it if using Solar Panels?

Philosophical question on logistic regression: why isn't the optimal threshold value trained?



Gulp.watch refreshes my browser one time, but then not again


Get the size of the screen, current web page and browser windowHow can I refresh a page with jQuery?How to combine gulp-watch and gulp-inject?Start hexo to generate a watch in a gulpfile.js?Gulp-sass won't compile scss files to css instead copy all files from scss folder to css folderbrowser not refreshed on gulp + browser sync + vim stackgulp with less and browser-syncHave to run gulp more than once to get Style changesBrowser-Sync - All events Hook - GulpBrowserSync not working running through gulpfile.js






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am having trouble setting up my browser to watch for changes in my html and css files and refresh the browser. Currently, it only works once.



I am a total js noob so I apologize since it looks like this has been answered already, but I was unable to apply the fixes to my situation.



Here is my gulpfile.js






var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))





Thank you!










share|improve this question






















  • Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

    – Mark
    Mar 9 at 22:01












  • Got it working now. Thanks!

    – Riley Hemphill
    Mar 9 at 22:16

















0















I am having trouble setting up my browser to watch for changes in my html and css files and refresh the browser. Currently, it only works once.



I am a total js noob so I apologize since it looks like this has been answered already, but I was unable to apply the fixes to my situation.



Here is my gulpfile.js






var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))





Thank you!










share|improve this question






















  • Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

    – Mark
    Mar 9 at 22:01












  • Got it working now. Thanks!

    – Riley Hemphill
    Mar 9 at 22:16













0












0








0








I am having trouble setting up my browser to watch for changes in my html and css files and refresh the browser. Currently, it only works once.



I am a total js noob so I apologize since it looks like this has been answered already, but I was unable to apply the fixes to my situation.



Here is my gulpfile.js






var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))





Thank you!










share|improve this question














I am having trouble setting up my browser to watch for changes in my html and css files and refresh the browser. Currently, it only works once.



I am a total js noob so I apologize since it looks like this has been answered already, but I was unable to apply the fixes to my situation.



Here is my gulpfile.js






var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))





Thank you!






var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))





var gulp = require('gulp');
var browserSync = require('browser-sync');

gulp.task('browserSync',function()
browserSync.init(null,
open : false,
server :
baseDir : 'site',

index : "index.html"

);
console.log("finshed browser ");
);

gulp.task('watch', gulp.parallel('browserSync', function()
gulp.watch('site/index.html', browserSync.reload);
gulp.watch('site/css/main.css', browserSync.reload);
))






javascript node.js gulp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 9 at 7:48









Riley HemphillRiley Hemphill

1




1












  • Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

    – Mark
    Mar 9 at 22:01












  • Got it working now. Thanks!

    – Riley Hemphill
    Mar 9 at 22:16

















  • Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

    – Mark
    Mar 9 at 22:01












  • Got it working now. Thanks!

    – Riley Hemphill
    Mar 9 at 22:16
















Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

– Mark
Mar 9 at 22:01






Try gulp.task('watch', gulp.parallel('browserSync', function(done) gulp.watch('site/index.html', browserSync.reload); gulp.watch('site/css/main.css', browserSync.reload); done(); )) You should also do the same for the 'browserSync' task.

– Mark
Mar 9 at 22:01














Got it working now. Thanks!

– Riley Hemphill
Mar 9 at 22:16





Got it working now. Thanks!

– Riley Hemphill
Mar 9 at 22:16












1 Answer
1






active

oldest

votes


















0














The code thatI ended up going with was






gulp.task('watch', gulp.parallel('browserSync', function() {
gulp.watch('site/index.html', function (done)
browserSync.reload();
done();
);
gulp.watch('site/css/main.css', function (done)
browserSync.reload();
done();
);





It's working now.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075167%2fgulp-watch-refreshes-my-browser-one-time-but-then-not-again%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The code thatI ended up going with was






    gulp.task('watch', gulp.parallel('browserSync', function() {
    gulp.watch('site/index.html', function (done)
    browserSync.reload();
    done();
    );
    gulp.watch('site/css/main.css', function (done)
    browserSync.reload();
    done();
    );





    It's working now.






    share|improve this answer



























      0














      The code thatI ended up going with was






      gulp.task('watch', gulp.parallel('browserSync', function() {
      gulp.watch('site/index.html', function (done)
      browserSync.reload();
      done();
      );
      gulp.watch('site/css/main.css', function (done)
      browserSync.reload();
      done();
      );





      It's working now.






      share|improve this answer

























        0












        0








        0







        The code thatI ended up going with was






        gulp.task('watch', gulp.parallel('browserSync', function() {
        gulp.watch('site/index.html', function (done)
        browserSync.reload();
        done();
        );
        gulp.watch('site/css/main.css', function (done)
        browserSync.reload();
        done();
        );





        It's working now.






        share|improve this answer













        The code thatI ended up going with was






        gulp.task('watch', gulp.parallel('browserSync', function() {
        gulp.watch('site/index.html', function (done)
        browserSync.reload();
        done();
        );
        gulp.watch('site/css/main.css', function (done)
        browserSync.reload();
        done();
        );





        It's working now.






        gulp.task('watch', gulp.parallel('browserSync', function() {
        gulp.watch('site/index.html', function (done)
        browserSync.reload();
        done();
        );
        gulp.watch('site/css/main.css', function (done)
        browserSync.reload();
        done();
        );





        gulp.task('watch', gulp.parallel('browserSync', function() {
        gulp.watch('site/index.html', function (done)
        browserSync.reload();
        done();
        );
        gulp.watch('site/css/main.css', function (done)
        browserSync.reload();
        done();
        );






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 9 at 22:18









        Riley HemphillRiley Hemphill

        1




        1





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075167%2fgulp-watch-refreshes-my-browser-one-time-but-then-not-again%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко