post-sequence
Sequence for configuration posthtml and postcss, sorts the configuration file based on the internal configurator.
Why?
Saves you from possible errors in the processing due to wrong wiring sequence plug-ins. You just pass in a configuration object of your processor, type of processor and reappointment or extension for internal configurator.
Install
$ npm i -S post-sequence
Note: This project is compatible with node v8+
Usage
; const posthtmlConfig = 'posthtml-bem': elemPrefix: '__' modPrefix: '-' modDlmtr: '--' 'posthtml-include': root: './' encoding: 'utf-8' 'posthtml-style-to-file': path: './dist/style.css' ; ;// Return ==> {"posthtml-include": {...}, "posthtml-style-to-file": {...}, "posthtml-bem": {...}}
Returns your config sorted according to the internal configuration or according to the extended.
posthtml configuration sequence
postcss configuration sequence
Options
processor
Type: string<posthtml|postcss>
Default: ``
extend
Type: array<array>
Default: []
Value: [index, ['plugin-name', ...]]
To determine the correct index, see the config