JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q57097F
  • License MIT

A sequence for configuration posthtml and postcss plugins

Package Exports

  • post-sequence

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (post-sequence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

post-sequence

Sequence for configuration posthtml and postcss, sorts the configuration file based on the internal configurator.

Travis Build StatusAppVeyor Build Statusnodenpm versionDependency StatusXO code styleCoveralls status

npm downloadsnpmPackage Quality

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

import sequence from 'post-sequence';

const posthtmlConfig = {
  'posthtml-bem': {
    elemPrefix: '__',
    modPrefix: '-',
    modDlmtr: '--'
  },
  'posthtml-include': {
    root: './',
    encoding: 'utf-8'
  },
  'posthtml-style-to-file': {
    path: './dist/style.css'
  }
};

sequence(posthtmlConfig, {processor: 'posthtml', extend: [2, 'posthtml-style-to-file']});
// 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

[
  "posthtml-include",
  "posthtml-modules",
  "posthtml-inline-assets",
  "posthtml-inline-css",
  "posthtml-beautify"
]

postcss configuration sequence

[
  "postcss-devtools",
  "postcss-easy-import",
  "postcss-import",
  "postcss-each",
  "postcss-mixins",
  "postcss-at-rules-variables",
  "postcss-custom-properties",
  "postcss-for",
  "postcss-conditionals",
  "postcss-nested",
  "postcss-sorting",
  "postcss-style-guide",
  "postcss-discard-comments",
  "postcss-csso"
]

Options

processor

Type: string<posthtml|postcss>
Default: ``

extend

Type: array<array>
Default: []
Value: [index, ['plugin-name', ...]]
To determine the correct index, see the config