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

Latest commit

 

History

History

css

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

css

🍣 A Rollup plugin that bundles imported css.

This is a fork of the rollup-plugin-css-only package.

Please refer to the original README for further information.

Usage

Create a rollup.config.js configuration file and import the plugin:

import { css } from "https://deno.land/x/[email protected]+0.20.0/plugins/css/mod.ts";

export default {
  input: "./src/mod.ts",
  output: {
    dir: "./dist",
    format: "es" as const,
  },
  plugins: [css()],
};

Then call rollup either via the CLI or the API.

Options

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.

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.

Meta

LICENSE (MIT)