Pattern Engine Extender for Pattern Lab Node
The Pattern Engine Extender allows Pattern Lab Node users to extend the pattern engine.
Installation
To add the plugin to your project using npm type:
npm install plugin-node-engine-extender --save
Or add it directly to your project's package.json
file and run npm install
Configuration
The plugin expects a config file to be available to import from a path specified in the patternlab config like this:
config
extensions.js
const helpers = { if arr && arrlength > 0 return arr } // Takes a Pattern Engine as an argument, modifies, and returns it.const applyHelpers = { for let key in helpers if helperskey engine return engine} moduleexports = applyHelpers