Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Latest commit

 

History

History

postcss

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

postcss

🍣 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.

Usage

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.

Options

autoModules

Type: boolean
Default: true

Automatically enable CSS modules for files with .module.* extensions.

exclude

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.

include

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.

modules

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.

output

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.

plugins

Type: Object[]
Default: null

PostCSS plugins to apply.

processOptions

Type: Object
Default: null

Options to pass to PostCSS.

Meta

LICENSE (MIT)