Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-multi-postcss

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-multi-postcss

Broccoli plugin to transform one or more input files using PostCSS to one or more output files.

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

broccoli-multi-postcss

Build Status npm version Download Total code style: prettier Dependabot enabled dependencies Status devDependencies Status

Broccoli plugin to transform one or more input files using PostCSS to one or more output files.

It's like broccoli-postcss, but allows you consume more than once input file at once. It also allows you to generate additional secondary output files.

Installation

yarn add broccoli-multi-postcss

Usage

import BroccoliMultiPostCSS from 'broccoli-multi-postcss';
import { plugin } from 'postcss';

const myPlugin = plugin('selector-metadata', options => {
  return (root, result) => {
    const selectors: string[] = [];
    root.walkRules(rule => {
      selectors.push(rule.selector);
    });

    const metadata = { selectors, fileName: result.opts.to };

    result.messages.push({
      type: BroccoliMultiPostCSS.MessageType.WriteFile,
      plugin: 'selector-metadata',
      path: `${result.opts.to}.meta.json`,
      content: JSON.stringify(metadata)
    });
  };
});

const tree = new BroccoliMultiPostCSS(['./styles'], { plugins: [myPlugin] });

FAQs

Package last updated on 09 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc