css-region-rebase
Rebase your CSS assets based on comment regions.
Think about what you can do when combining this with node-sass importer feature...^^
Installation
npm install css-region-rebase
Example
From:
/* region cssRebase: /path/to/rebase/your/assets/to */
.foo {
background: url(./foo.png);
}
/* endregion cssRebase: /path/to/rebase/your/assets/to */
To:
/* region cssRebase: /path/to/rebase/your/assets/to */
.foo {
background: url(/path/to/rebase/your/assets/to/foo.png);
}
/* endregion cssRebase: /path/to/rebase/your/assets/to */
API
let Rebaser = require('css-region-rebase')
rebaser = new Rebaser(opts={})
Return an object transform stream rebaser
that expects entry filenames.
Optionally pass in some opts:
- opts.format - the format used by your region. Defaults to
cssRebase:
.
Events
In addition to the usual events emitted by node.js streams, css-region-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