Rebase your CSS assets based on node-sass source comments.
npm install css-comment-rebase
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);
}
let Rebaser = require('css-comment-rebase')
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
.
In addition to the usual events emitted by node.js streams, css-comment-rebase emits the following events:
Every time an asset is rebased, this event fires with the rebased path.
- 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
Apache-2.0 © Eric MORAND