<commit_before># rollup-plugin-stylus-compiler

A rollup plugin to compile stylus file (`.styl`) to css file. This plugin only integrates [stylus](https://github.com/stylus/stylus) to do the compile job. 
Need other plugin to deal with the compiled css file. Such as use [rollup-plugin-postcss](https://github.com/egoist/rollup-plugin-postcss) 
to inline css into module, or use [rollup-plugin-css-only](https://github.com/thgh/rollup-plugin-css-only) to save css to a standalone file.

## Installation

```bash
npm install --save-dev rollup-plugin-stylus-compiler
```

## Usage

```js
import { rollup } from 'rollup';
import stylus from 'rollup-plugin-stylus-compiler';
import postcss from 'rollup-plugin-postcss';

rollup({
  entry: 'main.js',
  plugins: [ stylus(), postcss()]
});
```

## Build

```bash
npm run build
```<commit_msg>write some usage case to README<commit_after># rollup-plugin-stylus-compiler

A rollup plugin to compile stylus file (`.styl or .stylus`) to css file. This plugin only integrates [stylus](https://github.com/stylus/stylus) to do the compile job. 
Need other plugin to deal with the compiled css content. Such as:

- [rollup-plugin-css-porter] - output css to a standalone file, also with a minified version
- [rollup-plugin-postcss] - inline css into module
- [rollup-plugin-css-only] - output css to a standalone file.

## Installation

```bash
npm install --save-dev rollup-plugin-stylus-compiler
```

## Usage

### Case 1: use with [rollup-plugin-css-porter] plugin

```js
import { rollup } from 'rollup';
import stylus from 'rollup-plugin-stylus-compiler';
import css from 'rollup-plugin-css-porter';

rollup({
  entry: 'main.js',
  plugins: [ stylus(), css()]
}).then(bundle => {
  bundle.write({
    format: 'es',
    dest: 'bundle.js'
  });
});
```

Output `bundle.css` and `bundle.min.css`.

### Case 2: use with [rollup-plugin-postcss] plugin

```js
import { rollup } from 'rollup';
import stylus from 'rollup-plugin-stylus-compiler';
import postcss from 'rollup-plugin-postcss';

rollup({
  entry: 'main.js',
  plugins: [ stylus(), postcss()]
}).then(bundle => {
  bundle.write({
    format: 'es',
    dest: 'bundle.js'
  });
});
```

Inline css to `bundle.js`.


### Case 3: use with [rollup-plugin-css-only] plugin

```js
import { rollup } from 'rollup';
import stylus from 'rollup-plugin-stylus-compiler';
import css from 'rollup-plugin-css-only';

rollup({
  entry: 'main.js',
  plugins: [ stylus(), css()]
}).then(bundle => {
  bundle.write({
    format: 'es',
    dest: 'bundle.js'
  });
});
```

Output `bundle.css`.

## Build

```bash
npm run build
```

## Run Test

```bash
npm test
```


[rollup-plugin-postcss]: https://github.com/egoist/rollup-plugin-postcss
[rollup-plugin-css-porter]: https://github.com/thgh/rollup-plugin-css-porter
[rollup-plugin-css-only]: https://github.com/thgh/rollup-plugin-css-only
{'fraction_non_alphanumeric': 0.16474694589877836, 'fraction_numerical': 0.0010471204188481676, 'mean_word_length': 4.063604240282685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3448256', 'n_tokens_mistral': 1038, 'n_tokens_neox': 992, 'n_words': 275}