# gulp-rewrite-css

> Rewrite url references in CSS

Latest version **1.1.2** (published 2018-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-rewrite-css
pnpm add gulp-rewrite-css
yarn add gulp-rewrite-css
bun add gulp-rewrite-css
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2018-12-04 |
| First published | 2014-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-rewrite-css) |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 6 |
| Unpacked size | 10.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Maintainers | joscha |
| Keywords | gulpplugin, rewrite, css |

## Links

- npm: https://www.npmjs.com/package/gulp-rewrite-css
- Repository: https://github.com/joscha/gulp-rewrite-css
- Issues: https://github.com/joscha/gulp-rewrite-css/issues
- npm.io page: https://npm.io/package/gulp-rewrite-css

## Dependencies (6)

- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.2
- [ansi-green](https://npm.io/package/ansi-green.md) ^0.1.1
- [ansi-magenta](https://npm.io/package/ansi-magenta.md) ^0.1.1
- [event-stream](https://npm.io/package/event-stream.md) 3.3.4
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.0
- [bufferstreams](https://npm.io/package/bufferstreams.md) ~2.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2018-12-04
- 1.1.1 — 2018-01-21
- 1.1.0 — 2017-04-29
- 1.0.4 — 2017-02-19
- 1.0.3 — 2017-02-14
- 1.0.2 — 2017-02-10
- 1.0.1 — 2017-01-04
- 1.0.0 — 2016-11-05
- 0.0.9 — 2016-04-07
- 0.0.8 — 2015-12-04
- 0.0.7 — 2015-10-10
- 0.0.6 — 2015-09-27
- 0.0.5 — 2015-09-02
- 0.0.5-beta — 2015-02-10
- 0.0.4 — 2014-12-08
- … 3 more at https://npm.io/package/gulp-rewrite-css/versions

## README

#[gulp](https://github.com/gulpjs/gulp)-rewrite-css

[![Greenkeeper badge](https://badges.greenkeeper.io/joscha/gulp-rewrite-css.svg)](https://greenkeeper.io/)

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Dependency Status][depstat-image]][depstat-url]
[![devDependency Status][devdepstat-image]][devdepstat-url]

A gulp plugin that allows rewriting `url(…)` and `@import` references in CSS

## Installation

```console
npm install gulp-rewrite-css --save-dev
```

## Usage

```javascript
var gulp = require('gulp');
var rewriteCSS = require('gulp-rewrite-css');

gulp.task('my-rewrite', function() {
  var dest = './dist/';
  return gulp.src('./static/css/*.css')
    .pipe(rewriteCSS({destination:dest}))
    .pipe(gulp.dest(dest));
});
```
### Options
* `destination` (required, String) - the target directory for the processed CSS. Paths are rewritten relatively to that directory.
* `[debug]` (optional, boolean, defaults to false) - whether to log what gulp-rewrite-css is doing
* `[adaptPath]` (optional, Function, defaults to the internal rewriting method of gulp-rewrite-css) - will be passed a context hash that contains the following options:

	| key              | description                                                              |
	|------------------|--------------------------------------------------------------------------|
	| `sourceDir`      | the path in which the currently processed CSS file resides in            |
	| `sourceFile`     | the path to the currently processed CSS file                             |
	| `destinationDir` | the path of the target directory where the CSS file ends in              |
	| `targetFile`     | the path of the target file (e.g. the contents of `url(…)` or `@import`) |

## License
MIT (c) 2017 Joscha Feth <joscha@feth.com>

[npm-url]: https://npmjs.org/package/gulp-rewrite-css
[npm-image]: http://img.shields.io/npm/v/gulp-rewrite-css.svg

[travis-url]: https://travis-ci.org/joscha/gulp-rewrite-css
[travis-image]: http://img.shields.io/travis/joscha/gulp-rewrite-css.svg

[coveralls-url]: https://coveralls.io/r/joscha/gulp-rewrite-css
[coveralls-image]: http://img.shields.io/coveralls/joscha/gulp-rewrite-css.svg
[coveralls-original-image]: https://coveralls.io/repos/joscha/gulp-rewrite-css/badge.png

[depstat-url]: https://david-dm.org/joscha/gulp-rewrite-css
[depstat-image]: https://david-dm.org/joscha/gulp-rewrite-css.svg?theme=shields.io

[devdepstat-url]: https://david-dm.org/joscha/gulp-rewrite-css#info=devDependencies
[devdepstat-image]: https://david-dm.org/joscha/gulp-rewrite-css/dev-status.svg?theme=shields.io

---
_Source: https://npm.io/package/gulp-rewrite-css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
