Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rewrite option #368

Merged
merged 6 commits into from
Nov 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ new Processor({

Specify an array of PostCSS plugins to be run after files are processed, but before they are combined. Plugin will be passed a `to` and `from` option.

**By default** [`postcss-url`](https://www.npmjs.com/package/postcss-url) is used in `after` mode.
**By default** [`postcss-url`](https://www.npmjs.com/package/postcss-url) is run after any plugins defined in the `after` hook. To disable it see the [`rewrite`](#rewrite) option.

```js
new Processor({
@@ -72,6 +72,25 @@ new Processor({
});
```

### `rewrite`

Enable or disable the usage of [`postcss-url`](https://www.npmjs.com/package/postcss-url) to correct any URL references within the CSS. The value of `rewrite` will be passed to `postcss-url` to allow for configuration of the plugin.

```js
// On by default, so this will have rewritten url() references
new Processor();

// A falsey value will disable the usage of postcss-url, url() references will not be changed
new Processor({ rewrite : false });

// Configure postcss-url
new Processor({
rewrite : {
url : "inline"
}
});
```

### `map`

Enable source map generation. Can also be passed to `.output()`.
Loading