Register a new block name with the BlockFactory. Return true true if successful, false if already exists.
The new block name to register.
True or false depending on success status.
Parse a postcss.Root
into a Block object. Save the Block promise and return it.
The postcss.Root to parse.
A unique identifier for this Block file.
Default name for the block.
The Block object promise.
In some cases (like when using preprocessors with native bindings), it may be necessary to wait until the block factory has completed current asynchronous work before exiting. Calling this method stops new pending work from being performed and returns a promise that resolves when it is safe to exit.
Generated using TypeDoc
This factory ensures that instances of a block are re-used when blocks are going to be compiled/optimized together. Multiple instances of the same block will result in analysis and optimization bugs.
This also ensures that importers and preprocessors are correctly used when loading a block file.