🍣 A Rollup plugin to apply PostCSS transforms to styles.
This is a fork of the rollup-plugin-postcss
package.
Please refer to the original README for further information.
Create a rollup.config.js
configuration file and
import the plugin:
import { postcss } from "https://deno.land/x/[email protected]+0.20.0/plugins/postcss/mod.ts";
export default {
input: "./src/mod.ts",
output: {
dir: "./dist",
format: "es" as const,
},
plugins: [postcss()],
};
Then call rollup
either via the
CLI or the
API.
Type: boolean
Default: true
Automatically enable CSS modules for files with .module.*
extensions.
Type: string
| string[]
Default: null
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
Type: string
| string[]
Default: null
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.
Type: boolean
| Object
Default: false
Enable CSS modules for postcss-modules
.
If an object is provided, it is passed as options to the postcss-modules
library.
Type: string
| Function
| boolean
Default: null
One of:
- A string filename to write all styles to;
- A callback that will be called once generated with three arguments:
styles
: the contents of all style tags combined:"body { color: green }"
;styleNodes
: an array of style objects:[{ lang: "css", content: "body { color: green }" }]
;bundle
: the output bundle object;
false
to disable any style output or callbacks;null
for the default behaviour: to write all styles to the bundle destination where .js is replaced by .css.
Type: Object[]
Default: null
PostCSS plugins to apply.
Type: Object
Default: null
Options to pass to PostCSS.