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

Add support for glob matching when watching dir-dependency #391

Merged
merged 1 commit into from Sep 23, 2021

Conversation

1st8
Copy link
Contributor

@1st8 1st8 commented Aug 27, 2021

This extends #383 to pass glob information on to chokidar, with the intention of reducing outputs when unrelated files are modified.

In my test example the output should only be triggered when files matching the glob: '**/*.css' are modified, but not when the unrelated.md file is modified.

A real world example where I thought watching a whole directory without applying the glob could be problematic, would be a full stack project where tailwind checks backend templates by file type for purging:

  {
    plugin: 'tailwindcss',
    parent: '/home/1st8/sample_phoenix_project/assets/css/app.css',
    type: 'dir-dependency',
    dir: '/home/1st8/sample_phoenix_project',
    glob: '**/*.heex'
  }

In this case I really only want to trigger rebuilds when changing one of the listed file types.

Chokidar supports all this out of the box btw.

Let me know what you think and thanks for the great project!
Cheers!

This extends postcss#383 to pass glob information on to chokidar, with the intention of reducing outputs when unrelated files are modified
@RyanZim
Copy link
Collaborator

RyanZim commented Sep 23, 2021

I'm not closed to this idea; are there any plugins that use this .glob property? Dependency messages are standardized across the ecosystem, all runners will have to support this, cc @ai for thoughts.

@RyanZim
Copy link
Collaborator

RyanZim commented Sep 23, 2021

Ah, wasn't up on the standards changes, in that case, LGTM.

@RyanZim RyanZim merged commit 71f7d29 into postcss:master Sep 23, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants