PostCSS 8.1 fixed the new visitor API from the 8.0 release.
We fixed Root
and RootExit
re-calling on children's changes. And now visitors will visit the parent again if nested children were changed.
We added Once
and OnceExit
events, which will not be called again on node changes. You can use them to lint files or collect statistics:
module.exports = {
postcssPlugin: 'postcss-linter',
OnceExit (root) {
lint(root)
}
}
module.exports.postcss = true
We updated Migration guide according to new changes.