Skip to content

Commit ec912a9

Browse files
committed
Readme: installation, npm badge
1 parent 8d69add commit ec912a9

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# rollup-plugin-css-bundle
22

3-
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.
3+
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.
4+
5+
## Installation
6+
7+
<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>
8+
9+
```bash
10+
# using npm
11+
npm install --save-dev rollup-plugin-css-bundle
12+
13+
# using yarn
14+
yarn add --dev rollup-plugin-css-bundle
15+
```
416

517
## Usage
618

19+
In your **rollup.config.js** file:
20+
721
```js
8-
// rollup.config.js
922
import cssbundle from 'rollup-plugin-css-bundle';
1023

1124
export default {
@@ -14,17 +27,15 @@ export default {
1427
file: 'dist/index.js',
1528
format: 'cjs'
1629
},
17-
plugins: [
18-
cssbundle()
19-
]
20-
}
30+
plugins: [cssbundle()]
31+
};
2132
```
2233

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

25-
__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.
36+
**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.
2637

27-
__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_:
38+
**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_:
2839

2940
```js
3041
// rollup.config.js

0 commit comments

Comments
 (0)