edition-node-grunt
edition-node-grunt copied to clipboard
Watcher doesn't catch new files
I am using Edition Node Grunt v2.3.0 on Windows, with Node v6.3.1.
Expected Behavior
The Creation of new patterns should trigger the watcher to rebuild patternlab.
Actual Behavior
Nothing happens when new patterns are created. I have to restart my watch-task to trigger a rebuild.
Steps to Reproduce
Start the Watcher. Create a new pattern. See nothing happen.
Seems to be a general issue with grunt-contrib-watch or more specifically fs.watch (https://github.com/gruntjs/grunt-contrib-watch/issues/282)
My current workaround is to remove the call of path.resolve(...) around the paths that should be watched. Absolute paths seem to mess with grunt-contrib-watch
Thanks for this - I've had trouble understanding how to do this in the past and will definitely check this out.
Bump on this. I'm of course of no help from how to resolve the issue, but I'd like Pattern Lab to build when a new file is created. FWIW, when I use Pattern Lab PHP with Grunt, the watch command seems to catch new file creations. Here's the relevant code in Gruntfile.js:
watch: {
html: {
files: ['source/_patterns/**/*.mustache', 'source/**/*.json'],
tasks: ['shell:patternlab'],
options: {
spawn: false
}
}
}