css-comment-rebase

1.1.0 • Public • Published

css-comment-rebase

NPM version Build Status Dependency Status Coverage percentage

Rebase your CSS assets based on node-sass source comments.

Installation

npm install css-comment-rebase

Example

From:

/* line 2, /path/to/the/scss/source/foo.scss */
.foo {
    background: url(./foo.png);
}

To:

/* line 2, /path/to/the/scss/source/foo.scss */
.foo {
    background: url(/path/to/the/scss/source/foo.png);
}

API

let Rebaser = require('css-comment-rebase')

rebaser = new Rebaser(opts={})

Return an object transform stream rebaser that expects entry filenames.

Optionally pass in some opts:

  • opts.base:

    The path the assets should be rebased relatively to. Defaults to null.

Events

In addition to the usual events emitted by node.js streams, css-comment-rebase emits the following events:

rebaser.on('rebase', function(file) {})

Every time an asset is rebased, this event fires with the rebased path.

Contributing

  • Fork the main repository
  • Code
  • Implement tests using node-tap
  • Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue

License

Apache-2.0 © Eric MORAND

Readme

Keywords

none

Package Sidebar

Install

npm i css-comment-rebase

Weekly Downloads

1

Version

1.1.0

License

Apache-2.0

Last publish

Collaborators

  • ericmorand