less-plugin-custom-import
Adds the ability for less to import from custom directories.
lessc usage
Install with npm
npm install -g less-plugin-custom-import
specify plugin in lessc with --custom-import
Programmatic usage
var plugin = require("less-plugin-custom-import");
var pluginOptions = new plugin({
paths: {
vendors: '/path/to/app/vendors',
app: '/path/to/app/stylesheets'
}
});
less.render(css, {
plugins: [pluginOptions]
}).then(...
Now you can use inside your less files:
@import "vendors://bootstrap/bootstrap";
@import (less) "app://module/style.css";
Browser usage
Browser usage is not supported.
Testing
run the tests by running node test/index.js
You require the dev dependencies and less v2 in your node_modules (it will be added as a dev dependency once less v2 is released)