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 dir-dependency documentation #1580

Merged
merged 5 commits into from
May 13, 2021
Merged

Add dir-dependency documentation #1580

merged 5 commits into from
May 13, 2021

Conversation

bradlc
Copy link
Contributor

@bradlc bradlc commented May 13, 2021

As discussed in #1537 this pull request adds documentation for a new dir-dependency message type that can be used to signify that a plugin depends on the contents of a directory. This would be used in the same way as the dependency message but with a dir property instead of a file property:

result.messages.push({
  type: 'dir-dependency',
  plugin: 'postcss-import',
  dir: '/js',
  parent: result.opts.from
})

Runners should watch this directory for changes and rebuild the CSS when something changes.

This PR also adds some documentation for the existing dependency message to the plugin and runner guides, and clarifies the usage of dependency messages in the "Writing a PostCSS Plugin" documentation.

@mischnic
Copy link
Contributor

Is a dir-dependency recursive (= are changes in subdirectories also watched)?

@bradlc
Copy link
Contributor Author

bradlc commented May 13, 2021

Is a dir-dependency recursive (= are changes in subdirectories also watched)?

I would say so, yes. Do you think the documentation should mention that?

@ai
Copy link
Member

ai commented May 13, 2021

Do you think the documentation should mention that?

It is better to mention.

docs/guidelines/plugin.md Outdated Show resolved Hide resolved
docs/guidelines/plugin.md Outdated Show resolved Hide resolved
bradlc and others added 2 commits May 13, 2021 18:18
@bradlc
Copy link
Contributor Author

bradlc commented May 13, 2021

Thanks for the feedback @ai. I have made some changes 👍

@bradlc
Copy link
Contributor Author

bradlc commented May 17, 2021

@mischnic I have opened a pull request for this over on the Parcel repo.

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.

3 participants