Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koffeine/rollup-plugin-postcss
Rollup plugin for PostCSS
https://github.com/koffeine/rollup-plugin-postcss
postcss rollup rollup-plugin
Last synced: 13 days ago
JSON representation
Rollup plugin for PostCSS
- Host: GitHub
- URL: https://github.com/koffeine/rollup-plugin-postcss
- Owner: koffeine
- License: mit
- Created: 2021-04-17T17:21:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-23T06:59:40.000Z (over 3 years ago)
- Last Synced: 2025-01-20T12:48:41.082Z (14 days ago)
- Topics: postcss, rollup, rollup-plugin
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
rollup-plugin-postcss
Rollup plugin for PostCSS
## What it does
- Transforms imported CSS files using PostCSS plugins
- Concatenates and extracts processed styles## Features
- Sourcemap support
- Only generates and saves sourcemap when requested by the configuration
- Generates correct sourcemap file that traces back to the original imported file
- Makes sources relative to cwd by default, but this can be overridden with a custom sourcemapPathTransform function## Installation
```sh
npm install @koffeine/rollup-plugin-postcss postcss --save-dev
```## Usage
```js
import postcss from '@koffeine/rollup-plugin-postcss';export default {
plugins: [
postcss({
// which files should be processed by this plugin
// type: regular expression, minimatch pattern or an array of regular expressions and minimatch patterns
include: /\.css/u,// which files should not be processed by this plugin
// type: regular expression, minimatch pattern or an array of regular expressions and minimatch patterns
exclude: undefined,// whether or not to generate and save a sourcemap
// type: boolean
sourcemap: false,// transformation to apply to each source path in a sourcemap
// type: (source: string, id: string) => string
// source: sourcemap source
// id: module id (as reported by Rollup)
// returns: transformed path
sourcemapPathTransform: (source) => path.relative(process.cwd(), source),// which PostCSS plugins to use
// type: array of PostCSS plugins
plugins: [],// where to save the output file which is a Rollup asset relative to output.dir (required)
// type: string
output: undefined
})
]
};
```## License
Copyright © Kornél Horváth
Licensed under the [MIT License](https://raw.githubusercontent.com/koffeine/rollup-plugin-postcss/master/LICENSE).