# css-asset-rebaser

> Copy assets from node_modules and rewrite URLs in CSS

Latest version **0.4.0** (published 2016-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-asset-rebaser
pnpm add css-asset-rebaser
yarn add css-asset-rebaser
bun add css-asset-rebaser
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2016-01-14 |
| First published | 2015-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | tschaub |

## Links

- npm: https://www.npmjs.com/package/css-asset-rebaser
- Repository: https://github.com/tschaub/css-asset-rebaser
- Homepage: https://github.com/tschaub/css-asset-rebaser#readme
- Issues: https://github.com/tschaub/css-asset-rebaser/issues
- npm.io page: https://npm.io/package/css-asset-rebaser

## Dependencies (3)

- [css](https://npm.io/package/css.md) ^2.2.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.26.2
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7

## Recent versions

- 0.4.0 (latest) — 2016-01-14
- 0.3.0 — 2015-12-17
- 0.2.0 — 2015-11-06
- 0.1.0 — 2015-11-06

## README

# `css-asset-rebaser`

A gulp plugin for copying assets from `node_modules` and rewriting URLs in CSS.

## Example use

```js
var gulp = require('gulp');
var less = require('gulp-less');
var rebaser = require('css-asset-rebaser');

gulp.task('style', function() {
  gulp.src('src/**/main.less')
      .pipe(less({
        relativeUrls: true
      }))
      .pipe(rebaser({
        dest: 'build', // relative to process.cwd()
        assets: 'assets' // relative to "dest" above
      }))
      .pipe(gulp.dest('build'));
});
```

## Options

 * `dest` - `string` Required path to destination directory for build artifacts.  This should be the same path that you provide to `gulp.dest()`.  If a relative path is provided, the absolute path will be resolved from `process.cwd()`.

 * `assets` - `string` Optional path for assets within the `dest` directory.  If not provided, `dest` is used as the assets directory.  Any assets (images, fonts, etc.) found in the input CSS that are in `node_modules`, will be copied to this directory, preserving the relative path from `node_modules` (e.g. if `dest` is `build` and `assets` is `assets` then `node_modules/foo/img/bar.png` will be copied to `build/assets/foo/img/bar.png`).

[![Build Status](https://travis-ci.org/tschaub/css-asset-rebaser.svg)](https://travis-ci.org/tschaub/css-asset-rebaser)

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