PWA Studio Directive Parser
A Directive in Magento PWA Studio is an inline comment within a source file that signals additional metadata that should be processed by the PWA Studio tooling.
If you're a user of Magento PWA Studio, it's unlikely you're looking to depend on this package directly. The primary use-case for this library is to be consumed by other PWA Studio tools.
The primary goals of this project are:
- Run significantly faster than a parser that parses the entire ECMAScript grammar
- Provide actionable warnings/errors with location info
npm install @magento/directive-parser
const parseDirectives = ;const directives errors = ;
Example Directive (Kitchen Sink)
/*** @RootComponent* pageTypes = some_page, some_other_page* description = "Some description here"*/