src/build.js
function activatePostCSSPlugins(config) {
  const plugins = [];

  if (config.lintRules || config.lintRules !== "") {
    // TODO: Throw easy-to-understand error message
    // incorrect path? (ex. "lintRules": "aaa")
    // typo? (ex. "lintRules": "stylelint-config-suitcs")
    const lintRules = require(config.lintRules);

    if (lintRules.rules) {
      plugins.push(stylelint(lintRules));
    } else {
      throw new Error("Illegal lint rule: \"rules\" property is not found.");
    }
  }

  if (config.browsers && config.browsers !== "") {
    plugins.push(autoprefixer(config.browsers));
  }

  plugins.push(cssfmt);
  plugins.push(reporter);

  return plugins;
}
function activatePostCSSPlugins(config) {
  const plugins = [];

  if (config.lintRules || config.lintRules !== "") {
    // TODO: Throw easy-to-understand error message
    // incorrect path? (ex. "lintRules": "aaa")
    // typo? (ex. "lintRules": "stylelint-config-suitcs")
    const lintRules = require(config.lintRules);

    if (lintRules.rules) {
      plugins.push(stylelint(lintRules));
    } else {
      throw new Error("Illegal lint rule: \"rules\" property is not found.");
    }
  }

  if (config.browsers && config.browsers !== "") {
    plugins.push(autoprefixer(config.browsers));
  }

  plugins.push(cssfmt);
  plugins.push(reporter);

  return plugins;
}
function activatePostCSSPlugins ( config ) { const plugins = [ ] ; if ( config . lintRules || config . lintRules !== "" ) { // TODO: Throw easy-to-understand error message // incorrect path? (ex. "lintRules": "aaa") // typo? (ex. "lintRules": "stylelint-config-suitcs") const lintRules = require ( config . lintRules ) ; if ( lintRules . rules ) { plugins . push ( stylelint ( lintRules ) ) ; } else { throw new Error ( "Illegal lint rule: \"rules\" property is not found." ) ; } } if ( config . browsers && config . browsers !== "" ) { plugins . push ( autoprefixer ( config . browsers ) ) ; } plugins . push ( cssfmt ) ; plugins . push ( reporter ) ; return plugins ; }
Activating PostCSS plugins
@param {Object} config - Kotori config object
@returns {Function[]} PostCSS plugins list
@private
Activating PostCSS plugins