Pattern Lab emits numerous events during the build process. Some uses of events:
- Core uses
patternlab-pattern-change
events when watching for changes in order to trigger another build - Plugins such as plugin-tab can use an event like
patternlab-pattern-write-end
to define additional code tabs to the pattern viewer / modal
Learn more about Creating Plugins.
Emitted before any logic run inside build()
, which is the entry point for single builds, pattern-only builds, run singly or when watched.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
Emitted after all logic run inside build()
, which is the entry point for single builds, pattern-only builds, run singly or when watched.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
Emitted after patterns are iterated over to gather data about them. Right before Pattern Lab processes and renders patterns into HTML
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
Emitted after global data.json
and listitems.json
are read, and the supporting Pattern Lab templates are loaded into memory (header, footer, patternSection, patternSectionSubType, viewall). Right before patterns are iterated over to gather data about them.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
Emitted before all data is merged prior to a Pattern's render. Global data.json
is merged with any pattern .json
. Global listitems.json
is merged with any pattern .listitems.json
.
Kind: inner property of EVENTS
See: Pattern
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
pattern | Pattern |
current pattern |
Emitted before a pattern's template, HTML, and encoded HTML files are written to their output location
Kind: inner property of EVENTS
See: Pattern
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
pattern | Pattern |
current pattern |
Emitted after a pattern's template, HTML, and encoded HTML files are written to their output location
Kind: inner property of EVENTS
See: Pattern
Properties
Name | Type | Description |
---|---|---|
patternlab | object |
global data store |
pattern | Pattern |
current pattern |
Invoked when a watched asset changes. Assets include anything in source/
that is not under ['root', 'patterns', 'data', 'meta', 'annotations', 'patternlabFiles']
which are blacklisted for specific copying.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
fileInfo | object |
{file: 'path/to/file.css', dest: 'path/to/destination'} |
Invoked when a watched global file changes. These are files within the directories specified in ['data', 'meta']
paths.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
fileInfo | object |
{file: 'path/to/file.ext'} |
Invoked when a pattern changes.
Kind: inner property of EVENTS
Properties
Name | Type | Description |
---|---|---|
fileInfo | object |
{file: 'path/to/file.ext'} |
Pattern Lab Node is MIT Licensed