Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buschtoens/broccoli-multi-postcss
Broccoli plugin to transform one or more input files using PostCSS to one or more output files.
https://github.com/buschtoens/broccoli-multi-postcss
broccoli broccoli-plugin postcss
Last synced: 26 days ago
JSON representation
Broccoli plugin to transform one or more input files using PostCSS to one or more output files.
- Host: GitHub
- URL: https://github.com/buschtoens/broccoli-multi-postcss
- Owner: buschtoens
- License: isc
- Created: 2019-09-04T11:22:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T11:59:27.000Z (about 1 year ago)
- Last Synced: 2024-04-09T22:23:26.206Z (9 months ago)
- Topics: broccoli, broccoli-plugin, postcss
- Language: TypeScript
- Size: 81.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# broccoli-multi-postcss
[![Build Status](https://github.com/buschtoens/broccoli-multi-postcss/workflows/Node%20CI/badge.svg)](https://github.com/buschtoens/broccoli-multi-postcss/actions)
[![npm version](https://badge.fury.io/js/broccoli-multi-postcss.svg)](http://badge.fury.io/js/broccoli-multi-postcss)
[![Download Total](https://img.shields.io/npm/dt/broccoli-multi-postcss.svg)](http://badge.fury.io/js/broccoli-multi-postcss)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Dependabot enabled](https://img.shields.io/badge/dependabot-enabled-blue.svg?logo=dependabot)](https://dependabot.com/)
[![dependencies Status](https://david-dm.org/buschtoens/broccoli-multi-postcss/status.svg)](https://david-dm.org/buschtoens/broccoli-multi-postcss)
[![devDependencies Status](https://david-dm.org/buschtoens/broccoli-multi-postcss/dev-status.svg)](https://david-dm.org/buschtoens/broccoli-multi-postcss?type=dev)**Broccoli plugin to transform one or more input files using PostCSS to one or
more output files.**It's like [`broccoli-postcss`][broccoli-postcss], but allows you consume more
than once input file at once. It also allows you to generate additional
secondary output files.[broccoli-postcss]: https://github.com/jeffjewiss/broccoli-postcss
## Installation
```
yarn add broccoli-multi-postcss
```## Usage
```ts
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] });
```