mirror of
https://github.com/hanzoai/postcss.git
synced 2026-09-24 17:01:56 +00:00
Require PostCSS peer dependency from parser
This commit is contained in:
+6
-2
@@ -39,8 +39,9 @@ A good example of a parser is [Safe Parser], which parses malformed/broken CSS.
|
||||
Because there is no point to generate broken output, this package only provides
|
||||
a parser.
|
||||
|
||||
The parser API is a function which receives a string & returns a [`Root`] or [`Document`] node.
|
||||
The second argument is a function which receives an object with PostCSS options.
|
||||
The parser API is a function which receives a string & returns a [`Root`]
|
||||
or [`Document`] node. The second argument is a function which receives
|
||||
an object with PostCSS options.
|
||||
|
||||
```js
|
||||
const postcss = require('postcss')
|
||||
@@ -52,6 +53,9 @@ module.exports = function parse (css, opts) {
|
||||
}
|
||||
```
|
||||
|
||||
For open source parser npm package must have `postcss` in `peerDependencies`,
|
||||
not in direct `dependencies`.
|
||||
|
||||
[Safe Parser]: https://github.com/postcss/postcss-safe-parser
|
||||
[`Root`]: https://postcss.org/api/#root
|
||||
[`Document`]: https://postcss.org/api/#document
|
||||
|
||||
Reference in New Issue
Block a user