less-loader
Advanced tools
Comparing version 7.2.1 to 7.3.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [7.3.0](https://github.com/webpack-contrib/less-loader/compare/v7.2.1...v7.3.0) (2021-01-21) | ||
### Features | ||
* added the `implementation` option ([84d957c](https://github.com/webpack-contrib/less-loader/commit/84d957cfe4fbd6c97619c647d0dd0917b99408ae)) | ||
### [7.2.1](https://github.com/webpack-contrib/less-loader/compare/v7.2.0...v7.2.1) (2020-12-28) | ||
@@ -7,0 +14,0 @@ |
@@ -49,3 +49,3 @@ "use strict"; | ||
try { | ||
result = await _less.default.render(data, lessOptions); | ||
result = await (options.implementation || _less.default).render(data, lessOptions); | ||
} catch (error) { | ||
@@ -52,0 +52,0 @@ if (error.filename) { |
@@ -34,2 +34,6 @@ { | ||
"type": "boolean" | ||
}, | ||
"implementation": { | ||
"description": "The implementation of the `Less` to be used (https://github.com/webpack-contrib/less-loader#implementation).", | ||
"type": "object" | ||
} | ||
@@ -36,0 +40,0 @@ }, |
{ | ||
"name": "less-loader", | ||
"version": "7.2.1", | ||
"version": "7.3.0", | ||
"description": "A Less loader for webpack. Compiles Less to CSS.", | ||
@@ -61,9 +61,9 @@ "license": "MIT", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.16.0", | ||
"eslint-config-prettier": "^7.1.0", | ||
"eslint": "^7.18.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-prettier": "^3.3.0", | ||
"husky": "^4.3.6", | ||
"husky": "^4.3.8", | ||
"jest": "^26.6.3", | ||
"less": "^4.0.0", | ||
"less": "^4.1.0", | ||
"lint-staged": "^10.5.3", | ||
@@ -73,5 +73,5 @@ "memfs": "^3.2.0", | ||
"prettier": "^2.2.1", | ||
"standard-version": "^9.0.0", | ||
"standard-version": "^9.1.0", | ||
"strip-ansi": "^6.0.0", | ||
"webpack": "^5.11.0" | ||
"webpack": "^5.16.0" | ||
}, | ||
@@ -78,0 +78,0 @@ "keywords": [ |
@@ -36,3 +36,3 @@ <div align="center"> | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
loader: "less-loader", // compiles Less to CSS | ||
@@ -55,2 +55,3 @@ }, | ||
| **[`webpackImporter`](#webpackimporter)** | `{Boolean}` | `true` | Enables/Disables the default Webpack importer. | | ||
| **[`implementation`](#implementation)** | `{Object}` | `less` | Setup Less implementation to use. | | ||
@@ -75,3 +76,3 @@ ### `lessOptions` | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -108,3 +109,3 @@ { | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -159,3 +160,3 @@ "style-loader", | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -186,3 +187,3 @@ "style-loader", | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -221,3 +222,3 @@ "style-loader", | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -318,2 +319,36 @@ "style-loader", | ||
### `implementation` | ||
Type: `Object` | ||
> ⚠ less-loader compatible with Less 3 and 4 versions | ||
The special `implementation` option determines which implementation of Less to use. Overrides the locally installed `peerDependency` version of `less`. | ||
**This option is only really useful for downstream tooling authors to ease the Less 3-to-4 transition.** | ||
**webpack.config.js** | ||
```js | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.less$/i, | ||
use: [ | ||
"style-loader", | ||
"css-loader", | ||
{ | ||
loader: "less-loader", | ||
options: { | ||
implementation: require("less"), | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}; | ||
``` | ||
## Examples | ||
@@ -332,3 +367,3 @@ | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -365,3 +400,3 @@ { | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -419,3 +454,3 @@ "style-loader", | ||
{ | ||
test: /\.less$/, | ||
test: /\.less$/i, | ||
use: [ | ||
@@ -422,0 +457,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
42897
275
542