Skip to content

Commit

Permalink
Readme: installation, npm badge
Browse files Browse the repository at this point in the history
  • Loading branch information
danburzo committed Oct 31, 2018
1 parent 8d69add commit ec912a9
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions README.md
@@ -1,11 +1,24 @@
# rollup-plugin-css-bundle

A [Rollup](https://github.com/rollup/rollup) plugin whose sole purpose is to collect all the CSS files you import into your project and bundle them into a single glorious CSS file. Refreshingly, it preserves the order in which the CSS files are imported. Soberingly, it does not generate source maps.
A [Rollup](https://github.com/rollup/rollup) plugin whose sole purpose is to collect all the CSS files you import into your project and bundle them into a single glorious CSS file. Refreshingly, it preserves the order in which the CSS files are imported. Soberingly, it does not generate source maps.

## Installation

<a href="https://www.npmjs.org/package/rollup-plugin-css-bundle"><img src="https://img.shields.io/npm/v/rollup-plugin-css-bundle.svg?style=flat" alt="npm version"></a>

```bash
# using npm
npm install --save-dev rollup-plugin-css-bundle

# using yarn
yarn add --dev rollup-plugin-css-bundle
```

## Usage

In your **rollup.config.js** file:

```js
// rollup.config.js
import cssbundle from 'rollup-plugin-css-bundle';

export default {
Expand All @@ -14,17 +27,15 @@ export default {
file: 'dist/index.js',
format: 'cjs'
},
plugins: [
cssbundle()
]
}
plugins: [cssbundle()]
};
```

Like all well-behaved Rollup plugins, cssbundle supports the __include__ and __exclude__ options that filter the files on which the plugin should run.
Like all well-behaved Rollup plugins, cssbundle supports the **include** and **exclude** options that filter the files on which the plugin should run.

__output__: _String_ is an optional path for the extracted CSS; when ommitted, we use the bundle's file name to fashion a path for the bundled CSS.
**output**: _String_ is an optional path for the extracted CSS; when ommitted, we use the bundle's file name to fashion a path for the bundled CSS.

__transform__: _Function_ is available for processing the CSS, such as with [postcss](https://github.com/postcss/postcss). It receives a string containing the code to process as its only parameter, and should return the processed code. _Par exemple_:
**transform**: _Function_ is available for processing the CSS, such as with [postcss](https://github.com/postcss/postcss). It receives a string containing the code to process as its only parameter, and should return the processed code. _Par exemple_:

```js
// rollup.config.js
Expand Down

0 comments on commit ec912a9

Please sign in to comment.