Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Watcher doesn't catch new files #13

Open
Schleuse opened this issue Aug 11, 2016 · 2 comments
Open

Watcher doesn't catch new files #13

Schleuse opened this issue Aug 11, 2016 · 2 comments

Comments

@Schleuse
Copy link

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 (gruntjs/grunt-contrib-watch#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

@bmuenzenmeyer
Copy link
Member

Thanks for this - I've had trouble understanding how to do this in the past and will definitely check this out.

@bradfrost
Copy link
Member

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
        }
      }
    }

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

No branches or pull requests

3 participants