Package Exports
- less-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (less-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
less loader for webpack
Usage
var css = require("!raw!less!./file.less");
// => returns compiled css code from file.less, resolves imports
var css = require("!css!less!./file.less");
// => returns compiled css code from file.less, resolves imports and url(...)s
Use in tandem with the style-loader
to add the css rules to your document:
require("!style!css!less!./file.less");
webpack config
module.exports = {
module: {
loaders: [
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader"
}
]
}
};
Then you only need to write: require("./file.less")