Skip to content

Add dir-dependency documentation#1580

Merged
ai merged 5 commits intopostcss:mainfrom
bradlc:dir-dependency
May 13, 2021
Merged

Add dir-dependency documentation#1580
ai merged 5 commits intopostcss:mainfrom
bradlc:dir-dependency

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.

@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

Comments