I have been trying to adopt the GruntFile.js in the WebApp Generator and mould it to my needs. The issue I am having with the generator is that it does not inject the LiveReload middleware snippet. So for example the following piece of code under the connect section of the GruntFile is as follows:
livereload: {
options: {
middleware: function (connect) {
return [
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app),
lrSnippet
];
}
}
}
This surely cannot be right since the lrSnippet needs to be called before mountFolder()? Right? So if I do the following:
livereload: {
options: {
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
}
It works on subsequent requests. So it will work on one request, then when I refresh, I it hangs. Refresh again it works. Very strange. I played around with the connect-livereload plugin and every subsequent request is a Cannot GET /. Does someone have a working livereload and grunt-watch GruntFile? I know the latest version of grunt-watch has liveReload baked in.
It's a known bug and we're currently looking into it.