rollup-plugin-postcss-only
A Rollup plugin to transform CSS via PostCSS.
Installation
Via npm:
npm i -D postcss @gluons/rollup-plugin-postcss-only
Via Yarn:
yarn add -D postcss @gluons/rollup-plugin-postcss-only
Usage
rollup.config.js
:
import postcss from '@gluons/rollup-plugin-postcss-only';
export default {
input: '<your input>',
output: {
file: '<your output file>',
format: '<your format>'
},
plugins: [
postcss(/** Options **/)
]
};
Options
include
Type: string | RegExp | Array<string | RegExp>
Default: [/\.(s?css|sass)$/i]
Pattern of files to include in processing.
exclude
Type: string | RegExp | Array<string | RegExp>
Default: undefined
Pattern of files to exclude from processing.
extract
Type: boolean
Default: true
Enable CSS extraction.
fileName
Type: string
Specify the name of extracted file.
config
Type: { path: string, context: any }
Default: {}
Configuration information for PostCSS.
See more information in postcss-load-config
-
path
: Path to PostCSS config file. -
context
: Context to pass into PostCSS config file.
plugins
Type: Plugin[]
Default: []
PostCSS plugins.