1.0.0-beta.0 • Published 11 months ago

rollup-plugin-require-css v1.0.0-beta.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

rollup-plugin-require-css

A rollup plugin for import css

NPM version Codacy Badge Test coverage npm download License

Sonar

DocumentationChange Log

Installing

# use pnpm
$ pnpm install -D rollup-plugin-require-css

# use npm
$ npm install -D rollup-plugin-require-css

# use yarn
$ yarn add -D rollup-plugin-require-css

Usage

  1. use import
// rollup.config.js
import requireCss from 'rollup-plugin-require-css'

export default {
  plugins: [requireCss(options)]
}
  1. use require
// rollup.config.js
const requireCss = require('rollup-plugin-require-css')

module.exports = {
  plugins: [requireCss(options)]
}

Types

interface Options {
  /**
   * The transform function is used for processing the CSS, it receives a string containing the code to process as an argument. The function should return a string.
   */
  transform?: (code: string) => string
  /**
   * An output file name for the css bundle.
   */
  output?: string
  /**
   * A single file, or array of files to include when minifying.
   */
  include?: string | string[]
  /**
   * A single file, or array of files to exclude when minifying.
   */
  exclude?: string | string[]
  /**
   * All css files being imported with a variable will use native CSS Modules.
   */
  styleSheet?: boolean
}

Support & Issues

Please open an issue here.

License

MIT