less-loader 8.1.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,7 +56,7 @@ And run `webpack` via your preferred method.
56
56
  | **[`additionalData`](#additionalData)** | `{String\|Function}` | `undefined` | Prepends/Appends `Less` code to the actual entry file. |
57
57
  | **[`sourceMap`](#sourcemap)** | `{Boolean}` | `compiler.devtool` | Enables/Disables generation of source maps. |
58
58
  | **[`webpackImporter`](#webpackimporter)** | `{Boolean}` | `true` | Enables/Disables the default Webpack importer. |
59
- | **[`implementation`](#implementation)** | `{Object}` | `less` | Setup Less implementation to use. |
59
+ | **[`implementation`](#implementation)** | `{Object\|String}` | `less` | Setup Less implementation to use. |
60
60
 
61
61
  ### `lessOptions`
62
62
 
@@ -316,7 +316,7 @@ module.exports = {
316
316
 
317
317
  ### `implementation`
318
318
 
319
- Type: `Object`
319
+ Type: `Object | String`
320
320
 
321
321
  > ⚠ less-loader compatible with Less 3 and 4 versions
322
322
 
@@ -324,6 +324,8 @@ The special `implementation` option determines which implementation of Less to u
324
324
 
325
325
  **This option is only really useful for downstream tooling authors to ease the Less 3-to-4 transition.**
326
326
 
327
+ #### Object
328
+
327
329
  **webpack.config.js**
328
330
 
329
331
  ```js
@@ -348,6 +350,32 @@ module.exports = {
348
350
  };
349
351
  ```
350
352
 
353
+ #### String
354
+
355
+ **webpack.config.js**
356
+
357
+ ```js
358
+ module.exports = {
359
+ module: {
360
+ rules: [
361
+ {
362
+ test: /\.less$/i,
363
+ use: [
364
+ "style-loader",
365
+ "css-loader",
366
+ {
367
+ loader: "less-loader",
368
+ options: {
369
+ implementation: require.resolve("less"),
370
+ },
371
+ },
372
+ ],
373
+ },
374
+ ],
375
+ },
376
+ };
377
+ ```
378
+
351
379
  ## Examples
352
380
 
353
381
  ### Normal usage
package/dist/index.js CHANGED
@@ -7,8 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _path = _interopRequireDefault(require("path"));
9
9
 
10
- var _less = _interopRequireDefault(require("less"));
11
-
12
10
  var _options = _interopRequireDefault(require("./options.json"));
13
11
 
14
12
  var _utils = require("./utils");
@@ -20,7 +18,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
18
  async function lessLoader(source) {
21
19
  const options = this.getOptions(_options.default);
22
20
  const callback = this.async();
23
- const lessOptions = (0, _utils.getLessOptions)(this, options);
21
+ const implementation = (0, _utils.getLessImplementation)(this, options.implementation);
22
+
23
+ if (!implementation) {
24
+ callback(new Error(`The Less implementation "${options.implementation}" not found`));
25
+ return;
26
+ }
27
+
28
+ const lessOptions = (0, _utils.getLessOptions)(this, options, implementation);
24
29
  const useSourceMap = typeof options.sourceMap === "boolean" ? options.sourceMap : this.sourceMap;
25
30
 
26
31
  if (useSourceMap) {
@@ -38,7 +43,7 @@ async function lessLoader(source) {
38
43
  let result;
39
44
 
40
45
  try {
41
- result = await (options.implementation || _less.default).render(data, lessOptions);
46
+ result = await implementation.render(data, lessOptions);
42
47
  } catch (error) {
43
48
  if (error.filename) {
44
49
  // `less` returns forward slashes on windows when `webpack` resolver return an absolute windows path in `WebpackFileManager`
@@ -50,10 +55,6 @@ async function lessLoader(source) {
50
55
  return;
51
56
  }
52
57
 
53
- if ("webpackLoaderContext" in _less.default) {
54
- delete _less.default.webpackLoaderContext;
55
- }
56
-
57
58
  const {
58
59
  css,
59
60
  imports
package/dist/options.json CHANGED
@@ -35,7 +35,14 @@
35
35
  },
36
36
  "implementation": {
37
37
  "description": "The implementation of the `Less` to be used (https://github.com/webpack-contrib/less-loader#implementation).",
38
- "type": "object"
38
+ "anyOf": [
39
+ {
40
+ "type": "string"
41
+ },
42
+ {
43
+ "type": "object"
44
+ }
45
+ ]
39
46
  }
40
47
  },
41
48
  "additionalProperties": false
package/dist/utils.js CHANGED
@@ -6,13 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getLessOptions = getLessOptions;
7
7
  exports.isUnsupportedUrl = isUnsupportedUrl;
8
8
  exports.normalizeSourceMap = normalizeSourceMap;
9
+ exports.getLessImplementation = getLessImplementation;
9
10
 
10
11
  var _path = _interopRequireDefault(require("path"));
11
12
 
12
- var _util = _interopRequireDefault(require("util"));
13
-
14
- var _less = _interopRequireDefault(require("less"));
15
-
16
13
  var _full = require("klona/full");
17
14
 
18
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -38,10 +35,11 @@ const MODULE_REQUEST_REGEX = /^[^?]*~/;
38
35
  * Creates a Less plugin that uses webpack's resolving engine that is provided by the loaderContext.
39
36
  *
40
37
  * @param {LoaderContext} loaderContext
38
+ * @param {object} implementation
41
39
  * @returns {LessPlugin}
42
40
  */
43
41
 
44
- function createWebpackLessPlugin(loaderContext) {
42
+ function createWebpackLessPlugin(loaderContext, implementation) {
45
43
  const resolve = loaderContext.getResolve({
46
44
  dependencyType: "less",
47
45
  conditionNames: ["less", "style"],
@@ -51,7 +49,7 @@ function createWebpackLessPlugin(loaderContext) {
51
49
  preferRelative: true
52
50
  });
53
51
 
54
- class WebpackFileManager extends _less.default.FileManager {
52
+ class WebpackFileManager extends implementation.FileManager {
55
53
  supports(filename) {
56
54
  if (filename[0] === "/" || IS_NATIVE_WIN32_PATH.test(filename)) {
57
55
  return true;
@@ -157,11 +155,12 @@ function createWebpackLessPlugin(loaderContext) {
157
155
  *
158
156
  * @param {object} loaderContext
159
157
  * @param {object} loaderOptions
158
+ * @param {object} implementation
160
159
  * @returns {Object}
161
160
  */
162
161
 
163
162
 
164
- function getLessOptions(loaderContext, loaderOptions) {
163
+ function getLessOptions(loaderContext, loaderOptions, implementation) {
165
164
  const options = (0, _full.klona)(typeof loaderOptions.lessOptions === "function" ? loaderOptions.lessOptions(loaderContext) || {} : loaderOptions.lessOptions || {});
166
165
  const lessOptions = {
167
166
  plugins: [],
@@ -173,26 +172,13 @@ function getLessOptions(loaderContext, loaderOptions) {
173
172
  const shouldUseWebpackImporter = typeof loaderOptions.webpackImporter === "boolean" ? loaderOptions.webpackImporter : true;
174
173
 
175
174
  if (shouldUseWebpackImporter) {
176
- lessOptions.plugins.unshift(createWebpackLessPlugin(loaderContext));
175
+ lessOptions.plugins.unshift(createWebpackLessPlugin(loaderContext, implementation));
177
176
  }
178
177
 
179
- const webpackContextDeprecated = _util.default.deprecate(context => context, "less.webpackLoaderContext is deprecated and will be removed in next major release. Instead use pluginManager.webpackLoaderContext (https://webpack.js.org/loaders/less-loader/#plugins)");
180
-
181
178
  lessOptions.plugins.unshift({
182
179
  install(lessProcessor, pluginManager) {
183
180
  // eslint-disable-next-line no-param-reassign
184
- pluginManager.webpackLoaderContext = loaderContext; // Todo remove in next major release
185
-
186
- if (typeof lessProcessor.webpackLoaderContext === "undefined") {
187
- Object.defineProperty(lessProcessor, "webpackLoaderContext", {
188
- configurable: true,
189
-
190
- get() {
191
- return webpackContextDeprecated(loaderContext);
192
- }
193
-
194
- });
195
- }
181
+ pluginManager.webpackLoaderContext = loaderContext;
196
182
  }
197
183
 
198
184
  });
@@ -222,4 +208,24 @@ function normalizeSourceMap(map) {
222
208
 
223
209
  newMap.sources = newMap.sources.map(source => _path.default.normalize(source));
224
210
  return newMap;
211
+ }
212
+
213
+ function getLessImplementation(loaderContext, implementation) {
214
+ let resolvedImplementation = implementation;
215
+
216
+ if (!implementation || typeof implementation === "string") {
217
+ const lessImplPkg = implementation || "less";
218
+
219
+ try {
220
+ // eslint-disable-next-line import/no-dynamic-require, global-require
221
+ resolvedImplementation = require(lessImplPkg);
222
+ } catch (error) {
223
+ loaderContext.emitError(error); // eslint-disable-next-line consistent-return
224
+
225
+ return;
226
+ }
227
+ } // eslint-disable-next-line consistent-return
228
+
229
+
230
+ return resolvedImplementation;
225
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "less-loader",
3
- "version": "8.1.0",
3
+ "version": "10.0.0",
4
4
  "description": "A Less loader for webpack. Compiles Less to CSS.",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/less-loader",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "main": "dist/cjs.js",
15
15
  "engines": {
16
- "node": ">= 10.13.0"
16
+ "node": ">= 12.13.0"
17
17
  },
18
18
  "scripts": {
19
19
  "start": "npm run build -- -w",
@@ -21,7 +21,7 @@
21
21
  "prebuild": "npm run clean",
22
22
  "build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
23
23
  "commitlint": "commitlint --from=master",
24
- "security": "npm audit",
24
+ "security": "npm audit --production",
25
25
  "lint:prettier": "prettier --list-different .",
26
26
  "lint:js": "eslint --cache .",
27
27
  "lint": "npm-run-all -l -p \"lint:**\"",
@@ -30,9 +30,8 @@
30
30
  "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
31
31
  "pretest": "npm run lint",
32
32
  "test": "npm run test:coverage",
33
- "prepare": "npm run build",
34
- "release": "standard-version",
35
- "defaults": "webpack-defaults"
33
+ "prepare": "husky install && npm run build",
34
+ "release": "standard-version"
36
35
  },
37
36
  "files": [
38
37
  "dist"
@@ -45,31 +44,29 @@
45
44
  "klona": "^2.0.4"
46
45
  },
47
46
  "devDependencies": {
48
- "@babel/cli": "^7.12.10",
49
- "@babel/core": "^7.12.10",
50
- "@babel/preset-env": "^7.12.11",
51
- "@commitlint/cli": "^11.0.0",
52
- "@commitlint/config-conventional": "^11.0.0",
53
- "@webpack-contrib/defaults": "^6.3.0",
47
+ "@babel/cli": "^7.14.5",
48
+ "@babel/core": "^7.14.6",
49
+ "@babel/preset-env": "^7.14.5",
50
+ "@commitlint/cli": "^12.1.4",
51
+ "@commitlint/config-conventional": "^12.1.4",
54
52
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
55
- "babel-jest": "^26.6.3",
53
+ "babel-jest": "^27.0.2",
56
54
  "cross-env": "^7.0.3",
57
55
  "del": "^6.0.0",
58
- "del-cli": "^3.0.1",
59
- "eslint": "^7.19.0",
60
- "eslint-config-prettier": "^7.2.0",
61
- "eslint-plugin-import": "^2.22.1",
62
- "eslint-plugin-prettier": "^3.3.0",
63
- "husky": "^4.3.8",
64
- "jest": "^26.6.3",
56
+ "del-cli": "^4.0.0",
57
+ "eslint": "^7.28.0",
58
+ "eslint-config-prettier": "^8.3.0",
59
+ "eslint-plugin-import": "^2.23.4",
60
+ "husky": "^6.0.0",
61
+ "jest": "^27.0.4",
65
62
  "less": "^4.1.1",
66
- "lint-staged": "^10.5.3",
67
- "memfs": "^3.2.0",
63
+ "lint-staged": "^11.0.0",
64
+ "memfs": "^3.2.2",
68
65
  "npm-run-all": "^4.1.5",
69
- "prettier": "^2.2.1",
70
- "standard-version": "^9.1.0",
71
- "strip-ansi": "^6.0.0",
72
- "webpack": "^5.19.0"
66
+ "prettier": "^2.3.1",
67
+ "standard-version": "^9.3.0",
68
+ "strip-ansi": "^7.0.0",
69
+ "webpack": "^5.39.1"
73
70
  },
74
71
  "keywords": [
75
72
  "webpack",
package/CHANGELOG.md DELETED
@@ -1,311 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ## [8.1.0](https://github.com/webpack-contrib/less-loader/compare/v8.0.0...v8.1.0) (2021-04-09)
6
-
7
-
8
- ### Features
9
-
10
- * added the `pluginManager.webpackLoaderContext` property for `less` plugin developers, deprecated the `less.webpackLoaderContext` property, it fixed memory leak, please read [this](https://github.com/webpack-contrib/less-loader#plugins) ([#412](https://github.com/webpack-contrib/less-loader/issues/412)) ([e576240](https://github.com/webpack-contrib/less-loader/commit/e5762404093ec6246079c6b975c9f93c0a521bd9))
11
-
12
- ## [8.0.0](https://github.com/webpack-contrib/less-loader/compare/v7.3.0...v8.0.0) (2021-02-01)
13
-
14
-
15
- ### Notes
16
-
17
- * using `~` is deprecated and can be removed from your code (**we recommend it**), but we still support it for historical reasons.
18
-
19
- Why you can removed it?
20
- The loader will first try to resolve `@import` as relative, if it cannot be resolved, the loader will try to resolve `@import` inside [`node_modules`](https://webpack.js.org/configuration/resolve/#resolve-modules).
21
-
22
- ### ⚠ BREAKING CHANGES
23
-
24
- * minimum supported `webpack` version is `5`
25
-
26
- ### Features
27
-
28
- * supported the [`resolve.byDependency`](https://webpack.js.org/configuration/resolve/#resolvebydependency) option, you can setup `{ resolve: { byDependency: { less: { mainFiles: ['custom', '...'] } } } }`
29
-
30
- ## [7.3.0](https://github.com/webpack-contrib/less-loader/compare/v7.2.1...v7.3.0) (2021-01-21)
31
-
32
-
33
- ### Features
34
-
35
- * added the `implementation` option ([84d957c](https://github.com/webpack-contrib/less-loader/commit/84d957cfe4fbd6c97619c647d0dd0917b99408ae))
36
-
37
- ### [7.2.1](https://github.com/webpack-contrib/less-loader/compare/v7.2.0...v7.2.1) (2020-12-28)
38
-
39
-
40
- ### Bug Fixes
41
-
42
- * errors from less ([#401](https://github.com/webpack-contrib/less-loader/issues/401)) ([ce31aca](https://github.com/webpack-contrib/less-loader/commit/ce31aca7aada70a8cc267449954ab38b642cd4ba))
43
-
44
- ## [7.2.0](https://github.com/webpack-contrib/less-loader/compare/v7.1.0...v7.2.0) (2020-12-23)
45
-
46
-
47
- ### Features
48
-
49
- * add less ^4.0 to peerDependencies ([#398](https://github.com/webpack-contrib/less-loader/issues/398)) ([3d1abb7](https://github.com/webpack-contrib/less-loader/commit/3d1abb7be041e44fce59b2109d02eada1451a4e4))
50
-
51
- ## [7.1.0](https://github.com/webpack-contrib/less-loader/compare/v7.0.2...v7.1.0) (2020-11-11)
52
-
53
-
54
- ### Features
55
-
56
- * allow the `additionalData` to be async ([#391](https://github.com/webpack-contrib/less-loader/issues/391)) ([62c6934](https://github.com/webpack-contrib/less-loader/commit/62c6934367eb4dd0d4f3155ed2bb5f3e065aafba))
57
-
58
- ### [7.0.2](https://github.com/webpack-contrib/less-loader/compare/v7.0.1...v7.0.2) (2020-10-09)
59
-
60
- ### Chore
61
-
62
- * update `schema-utils`
63
-
64
- ### [7.0.1](https://github.com/webpack-contrib/less-loader/compare/v7.0.0...v7.0.1) (2020-09-03)
65
-
66
-
67
- ### Bug Fixes
68
-
69
- * normalize `sources` in source maps ([877d99a](https://github.com/webpack-contrib/less-loader/commit/877d99a380deac92e07c41429a9b0c5f0bba2710))
70
-
71
- ## [7.0.0](https://github.com/webpack-contrib/less-loader/compare/v6.2.0...v7.0.0) (2020-08-25)
72
-
73
-
74
- ### ⚠ BREAKING CHANGES
75
-
76
- * move `less` to `peerDependencies`, the `implementation` option was removed
77
- * `prependData` and `appendData` option were removed in favor the `additionaldata` option
78
-
79
- ### Features
80
-
81
- * added `webpackImporter` option ([#377](https://github.com/webpack-contrib/less-loader/issues/377)) ([12dca5b](https://github.com/webpack-contrib/less-loader/commit/12dca5bb573740472cff8176b7aade184c773ebc))
82
- * added loader context in less plugins ([#378](https://github.com/webpack-contrib/less-loader/issues/378)) ([7b7fc5e](https://github.com/webpack-contrib/less-loader/commit/7b7fc5e841a2c7c587a980648056ed4762014e9d))
83
- * added `additionaldata` option ([#374](https://github.com/webpack-contrib/less-loader/issues/374)) ([2785803](https://github.com/webpack-contrib/less-loader/commit/27858037a2e307fdf437604300f14c8233df4568))
84
-
85
- ## [6.2.0](https://github.com/webpack-contrib/less-loader/compare/v6.1.3...v6.2.0) (2020-07-03)
86
-
87
-
88
- ### Features
89
-
90
- * support condition names from `package.json` ([#369](https://github.com/webpack-contrib/less-loader/issues/369)) ([671395d](https://github.com/webpack-contrib/less-loader/commit/671395d6a82425ba4408d1329d8cbfa07dfd9153))
91
-
92
- ### [6.1.3](https://github.com/webpack-contrib/less-loader/compare/v6.1.2...v6.1.3) (2020-06-29)
93
-
94
-
95
- ### Bug Fixes
96
-
97
- * revert restrictions ([e758837](https://github.com/webpack-contrib/less-loader/commit/e75883706fc3d3bb2b6283a727a405216473362e))
98
-
99
- ### [6.1.2](https://github.com/webpack-contrib/less-loader/compare/v6.1.1...v6.1.2) (2020-06-22)
100
-
101
-
102
- ### Bug Fixes
103
-
104
- * ignore watch for remove URLs ([3946937](https://github.com/webpack-contrib/less-loader/commit/39469376e28cd0e38162f7bdf8935d343830a40e))
105
- * resolution logic ([2c3a23a](https://github.com/webpack-contrib/less-loader/commit/2c3a23a440cbdad1edb8b232864cb0233a266782))
106
- * resolve absolute and root relative imports ([3d01b82](https://github.com/webpack-contrib/less-loader/commit/3d01b82fae335d5d69d6290911e788debc732182))
107
-
108
- ### [6.1.1](https://github.com/webpack-contrib/less-loader/compare/v6.1.0...v6.1.1) (2020-06-11)
109
-
110
-
111
- ### Bug Fixes
112
-
113
- * do not rebuilt unmodified files on windows in watch mode ([6537a3d](https://github.com/webpack-contrib/less-loader/commit/6537a3d66559464af9b9a25f4bdda8691e8d9407))
114
-
115
- ## [6.1.0](https://github.com/webpack-contrib/less-loader/compare/v6.0.0...v6.1.0) (2020-05-07)
116
-
117
-
118
- ### Features
119
-
120
- * new `implementation` option ([#354](https://github.com/webpack-contrib/less-loader/issues/354)) ([d2de80f](https://github.com/webpack-contrib/less-loader/commit/d2de80f9fe6ee11e784260dbda960853ebd2449b))
121
-
122
-
123
- ### Bug Fixes
124
-
125
- * respect third-party plugins for `Less` ([#353](https://github.com/webpack-contrib/less-loader/issues/353)) ([d0db4f9](https://github.com/webpack-contrib/less-loader/commit/d0db4f9839c4921440c9a0fdc00fd00bc5a6fbb8))
126
-
127
- ## [6.0.0](https://github.com/webpack-contrib/less-loader/compare/v5.0.0...v6.0.0) (2020-04-24)
128
-
129
-
130
- ### ⚠ BREAKING CHANGES
131
-
132
- * minimum supported Node.js version is `10.13`,
133
- * minimum support webpack version is `4`
134
- * `2` version of `less` is not supported anymore
135
- * using `3` versin of `less` by default, so you don't need to have `less` in your `package.json`, we already supply it
136
- * move less-specific options to the `lessOptions` option, please look at [README](https://github.com/webpack-contrib/less-loader#lessoptions)
137
-
138
-
139
- ### Features
140
-
141
- * the `paths` options now works with webpack resolver ([3931470](https://github.com/webpack-contrib/less-loader/commit/393147064672ace986ec84aca21f69f0ab819a9c))
142
- * allow a function to be used for `lessOptions` ([#325](https://github.com/webpack-contrib/less-loader/issues/325)) ([a6be94a](https://github.com/webpack-contrib/less-loader/commit/a6be94a6da291a27026415d509249e0203e977ad))
143
- * added the `appendData` option ([#336](https://github.com/webpack-contrib/less-loader/issues/336)) ([fb94605](https://github.com/webpack-contrib/less-loader/commit/fb946051bb4d52a6f9a93fe40a8cd09a56a2c5f1))
144
- * added the `prependData` option ([#327](https://github.com/webpack-contrib/less-loader/issues/327)) ([9df8755](https://github.com/webpack-contrib/less-loader/commit/9df87554ee1ac57d2c32743049174da20e8a8a61))
145
- * support `less` and `style` fields in `package.json`
146
- * support `index.less` file for packages
147
-
148
- ### Bug Fixes
149
-
150
- * support import aliases without tilde ([#335](https://github.com/webpack-contrib/less-loader/issues/335)) ([24021cd](https://github.com/webpack-contrib/less-loader/commit/24021cdb9dc0496fcebd6966516ff66584525cf3))
151
- * do not crash on remotely imports ([#333](https://github.com/webpack-contrib/less-loader/issues/333)) ([8e020e9](https://github.com/webpack-contrib/less-loader/commit/8e020e9cf794d958024cc91ad490b621d5170878))
152
- * add webpack v5 support ([#317](https://github.com/webpack-contrib/less-loader/issues/317)) ([f0b42b4](https://github.com/webpack-contrib/less-loader/commit/f0b42b4e64dceed0bbb2557c0d88d1c36fe3e553))
153
- * first resolve an import using less resolver, then using webpack resolver ([#340](https://github.com/webpack-contrib/less-loader/issues/340)) ([443bd5a](https://github.com/webpack-contrib/less-loader/commit/443bd5ac0539ca93a998326754bcd607aaecdf1a))
154
- * fix a resolution for `@import 'package/file.ess';` and `@import './package/file.ess';`
155
-
156
-
157
- <a name="5.0.0"></a>
158
- # [5.0.0](https://github.com/webpack-contrib/less-loader/compare/v4.1.0...v5.0.0) (2019-04-29)
159
-
160
-
161
- ### Bug Fixes
162
-
163
- * webpack watching does not recover after broken less is fixed ([#289](https://github.com/webpack-contrib/less-loader/issues/289)) ([f41d12e](https://github.com/webpack-contrib/less-loader/commit/f41d12e))
164
-
165
-
166
- ### Chores
167
-
168
- * remove old bits mentioning webpack < 4 and node < 6 ([#286](https://github.com/webpack-contrib/less-loader/issues/286)) ([012eb8f](https://github.com/webpack-contrib/less-loader/commit/012eb8f))
169
-
170
-
171
- ### Code Refactoring
172
-
173
- * remove deprecated compress option ([#283](https://github.com/webpack-contrib/less-loader/issues/283)) ([3d6e9e9](https://github.com/webpack-contrib/less-loader/commit/3d6e9e9))
174
-
175
-
176
- ### BREAKING CHANGES
177
-
178
- * remove deprecated compress option.
179
- * drop support for node < 6.9 and webpack < 4
180
-
181
-
182
-
183
- <a name="4.1.0"></a>
184
- # [4.1.0](https://github.com/webpack-contrib/less-loader/compare/v4.0.6...v4.1.0) (2018-03-09)
185
-
186
-
187
- ### Features
188
-
189
- * **package:** support `less >= v3.0.0` ([#242](https://github.com/webpack-contrib/less-loader/issues/242)) ([d8c9d83](https://github.com/webpack-contrib/less-loader/commit/d8c9d83))
190
-
191
-
192
-
193
- <a name="4.0.6"></a>
194
- ## [4.0.6](https://github.com/webpack-contrib/less-loader/compare/v4.0.5...v4.0.6) (2018-02-27)
195
-
196
-
197
- ### Bug Fixes
198
-
199
- * **package:** add `webpack >= v4.0.0` (`peerDependencies`) ([#245](https://github.com/webpack-contrib/less-loader/issues/245)) ([011cc73](https://github.com/webpack-contrib/less-loader/commit/011cc73))
200
-
201
-
202
-
203
- <a name="4.0.5"></a>
204
- ## [4.0.5](https://github.com/webpack-contrib/less-loader/compare/v4.0.4...v4.0.5) (2017-07-10)
205
-
206
-
207
- ### Chore
208
-
209
- * support `webpack@3` ([670ab18](https://github.com/webpack-contrib/less-loader/commit/670ab18))
210
-
211
-
212
- <a name="4.0.4"></a>
213
- ## [4.0.4](https://github.com/webpack-contrib/less-loader/compare/v4.0.3...v4.0.4) (2017-05-30)
214
-
215
-
216
- ### Bug Fixes
217
-
218
- * resolve `[@import](https://github.com/import)` with absolute paths ([#201](https://github.com/webpack-contrib/less-loader/issues/201)) ([a3f9601](https://github.com/webpack-contrib/less-loader/commit/a3f9601)), closes [webpack-contrib/less-loader#93](https://github.com/webpack-contrib/less-loader/issues/93)
219
-
220
-
221
-
222
- <a name="4.0.3"></a>
223
- ## [4.0.3](https://github.com/webpack-contrib/less-loader/compare/v4.0.2...v4.0.3) (2017-03-30)
224
-
225
-
226
- ### Bug Fixes
227
-
228
- * sourcesContent missing in source maps ([df28035](https://github.com/webpack-contrib/less-loader/commit/df28035))
229
-
230
-
231
-
232
- <a name="4.0.2"></a>
233
- ## [4.0.2](https://github.com/webpack-contrib/less-loader/compare/v4.0.1...v4.0.2) (2017-03-21)
234
-
235
-
236
- ### Bug Fixes
237
-
238
- * Plugin.install is not a function ([f8ae245](https://github.com/webpack-contrib/less-loader/commit/f8ae245))
239
-
240
-
241
-
242
- <a name="4.0.1"></a>
243
- ## [4.0.1](https://github.com/webpack-contrib/less-loader/compare/v4.0.0...v4.0.1) (2017-03-21)
244
-
245
-
246
- ### Bug Fixes
247
-
248
- * wrong entry point in package.json ([918bfe9](https://github.com/webpack-contrib/less-loader/commit/918bfe9)), closes [#161](https://github.com/webpack-contrib/less-loader/issues/161) [#179](https://github.com/webpack-contrib/less-loader/issues/179) [#177](https://github.com/webpack-contrib/less-loader/issues/177)
249
-
250
-
251
-
252
- <a name="4.0.0"></a>
253
- # [4.0.0](https://github.com/webpack-contrib/less-loader/compare/v3.0.0...v4.0.0) (2017-03-20)
254
-
255
-
256
- ### Bug Fixes
257
-
258
- * error where not all files were watched ([53c90fc](https://github.com/webpack-contrib/less-loader/commit/53c90fc))
259
- * resolve alias ([98d4e63](https://github.com/webpack-contrib/less-loader/commit/98d4e63))
260
-
261
-
262
- ### Chores
263
-
264
- * **dependencies:** Update peer dependencies ([24a6f66](https://github.com/webpack-contrib/less-loader/commit/24a6f66))
265
-
266
-
267
- ### Features
268
-
269
- * **source-maps:** refactor source maps handling ([895044f](https://github.com/webpack-contrib/less-loader/commit/895044f))
270
- * allow user to choose between resolvers ([1d6e505](https://github.com/webpack-contrib/less-loader/commit/1d6e505))
271
- * improve formatting of error messages ([39772a5](https://github.com/webpack-contrib/less-loader/commit/39772a5))
272
- * make any file type importable ([d3022b8](https://github.com/webpack-contrib/less-loader/commit/d3022b8))
273
- * remove root option ([39ad4f8](https://github.com/webpack-contrib/less-loader/commit/39ad4f8))
274
-
275
-
276
- ### BREAKING CHANGES
277
-
278
- * If you've already configured your `resolve.alias` with a `.less` extension, you can now remove that wrong extension.
279
- * The root option was never documented, so it's very unlikely that this is actually a breaking change. However, since the option was removed, we need to flag this as breaking.
280
- * **dependencies:** Require webpack 2 as peer dependency
281
- * **source-maps:** Since the map is now passed as an object to the next loader, this could potentially break if another loader than the css-loader is used. The css-loader accepts both.
282
-
283
-
284
-
285
- Changelog
286
- ---------
287
-
288
- ### 3.0.0
289
-
290
- - **Breaking**: Remove node 0.10 and 0.12 support
291
- - **Breaking**: Remove official webpack 1 support. There are no breaking changes for webpack 1 with `3.0.0`, but future release won't be tested against webpack 1
292
- - **Breaking**: Remove synchronous compilation support [#152](https://github.com/webpack-contrib/less-loader/pull/152) [#84](https://github.com/webpack-contrib/less-loader/issues/84)
293
- - Reduce npm package size by using the [files](https://docs.npmjs.com/files/package.json#files) property in the `package.json`
294
-
295
-
296
- ### 2.2.3
297
-
298
- - Fix missing path information in source map [#73](https://github.com/webpack/less-loader/pull/73)
299
- - Add deprecation warning [#84](https://github.com/webpack/less-loader/issues/84)
300
-
301
- ### 2.2.2
302
-
303
- - Fix issues with synchronous less functions like `data-uri()`, `image-size()`, `image-width()`, `image-height()` [#31](https://github.com/webpack/less-loader/issues/31) [#38](https://github.com/webpack/less-loader/issues/38) [#43](https://github.com/webpack/less-loader/issues/43) [#58](https://github.com/webpack/less-loader/pull/58)
304
-
305
- ### 2.2.1
306
-
307
- - Improve Readme
308
-
309
- ### 2.2.0
310
-
311
- - Added option to specify LESS plugins [#40](https://github.com/webpack/less-loader/pull/40)