Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

livereload overrides existing watches #49

Open
amctammany opened this issue Mar 31, 2014 · 4 comments
Open

livereload overrides existing watches #49

amctammany opened this issue Mar 31, 2014 · 4 comments

Comments

@amctammany
Copy link

I'm running an Express server through my own yeoman generator using grunt-express. I set a watch for Stylus files as such

    stylus: {
        files: ['<%= yeoman.app %>/styles/src/**/*.styl'],
        tasks: ['stylus']
    },

The stylus task works normally when called.

My issue is when I set livereload to true in my express task, the watch it creates overrides the watch I made for stylus files. In my server logs I can see that the .styl file has been modified, but it just reloads it and never calls the stylus task.

Any help would be appreciated.

@amctammany
Copy link
Author

I solved my own problem by removing the livereload option from my grunt-express task and set up my own livereload watch using the livereload option provided by grunt-watch and adding the livereload script to my webpage. I still think this it's an issue that grunt-express takes precedence over all other watch calls, but that's just my $0.02.

@blai
Copy link
Owner

blai commented Apr 30, 2014

Yes, indeed. grunt-express uses grunt-contrib-watch (by setting up dynamic sub-tasks under watch) to perform both serverreload and livereload. The problem is that grunt-contrib-watch has this logic that would basically executes queued tasks sequentially, and in our case, the serverreload creates a watch task that would never complete (so the server can continue running), which blocks other watch tasks. It may take some enhancement from grunt-contrib-watch side to fix this.

@levjj
Copy link

levjj commented Jul 11, 2014

I think it would be good to mention in the readme file that serverreload: true and livereload: true are both incompatible with any existing watch tasks. I struggled with this issue quite a bit until I gave up and used grunt-contrib-connect for live-reloading.

@flyingsky
Copy link

@levjj totally agree, this issue still exists!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants