less-loader
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -24,3 +24,3 @@ /* | ||
}; | ||
var context = currentFileInfo.currentDirectory; | ||
var context = currentFileInfo.currentDirectory.replace(/[\\\/]$/, ""); | ||
var moduleName = urlToRequire(file) | ||
@@ -27,0 +27,0 @@ if(cb) { |
{ | ||
"name": "less-loader", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "less loader module for webpack", |
@@ -6,11 +6,33 @@ # less loader for webpack | ||
``` javascript | ||
var css = require("less!./file.less"); | ||
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 | ||
``` | ||
Don't forget to polyfill `require` if you want to use it in node. | ||
See `webpack` documentation. | ||
Use in tandem with the [`style-loader`](https://github.com/webpack/style-loader) to add the css rules to your document: | ||
``` javascript | ||
require("!style!css!less!./file.less"); | ||
``` | ||
### webpack config | ||
``` javascript | ||
module.exports = { | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.less$/, | ||
loader: "style-loader!css-loader!less-loader" | ||
} | ||
] | ||
} | ||
}; | ||
``` | ||
Then you only need to write: `require("./file.less")` | ||
## License | ||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
MIT (http://www.opensource.org/licenses/mit-license.php) |
@@ -0,0 +0,0 @@ /* |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3629
38