less-loader 8.1.1 → 10.0.1

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,10 +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 webpackContextSymbol = Symbol("loaderContext");
24
- const lessOptions = (0, _utils.getLessOptions)(this, { ...options,
25
- webpackContextSymbol
26
- });
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);
27
29
  const useSourceMap = typeof options.sourceMap === "boolean" ? options.sourceMap : this.sourceMap;
28
30
 
29
31
  if (useSourceMap) {
@@ -41,7 +43,7 @@ async function lessLoader(source) {
41
43
  let result;
42
44
 
43
45
  try {
44
- result = await (options.implementation || _less.default).render(data, lessOptions);
46
+ result = await implementation.render(data, lessOptions);
45
47
  } catch (error) {
46
48
  if (error.filename) {
47
49
  // `less` returns forward slashes on windows when `webpack` resolver return an absolute windows path in `WebpackFileManager`
@@ -53,7 +55,8 @@ async function lessLoader(source) {
53
55
  return;
54
56
  }
55
57
 
56
- delete _less.default[webpackContextSymbol];
58
+ delete lessOptions.pluginManager.webpackLoaderContext;
59
+ delete lessOptions.pluginManager;
57
60
  const {
58
61
  css,
59
62
  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,29 +172,14 @@ 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
178
  lessOptions.plugins.unshift({
180
179
  install(lessProcessor, pluginManager) {
181
180
  // eslint-disable-next-line no-param-reassign
182
- pluginManager.webpackLoaderContext = loaderContext; // Todo remove in next major release `lessProcessor[webpackContextSymbol]`
183
-
184
- const {
185
- webpackContextSymbol
186
- } = options; // eslint-disable-next-line no-param-reassign
187
-
188
- lessProcessor[webpackContextSymbol] = loaderContext;
189
- Object.defineProperty(lessProcessor, "webpackLoaderContext", {
190
- configurable: true,
191
-
192
- get() {
193
- _util.default.deprecate(() => {}, "less.webpackLoaderContext is deprecated and will be removed in next major release. Instead use pluginManager.webpackLoaderContext (https://webpack.js.org/loaders/less-loader/#plugins)")();
194
-
195
- return lessProcessor[webpackContextSymbol];
196
- }
197
-
198
- });
181
+ pluginManager.webpackLoaderContext = loaderContext;
182
+ lessOptions.pluginManager = pluginManager;
199
183
  }
200
184
 
201
185
  });
@@ -225,4 +209,24 @@ function normalizeSourceMap(map) {
225
209
 
226
210
  newMap.sources = newMap.sources.map(source => _path.default.normalize(source));
227
211
  return newMap;
212
+ }
213
+
214
+ function getLessImplementation(loaderContext, implementation) {
215
+ let resolvedImplementation = implementation;
216
+
217
+ if (!implementation || typeof implementation === "string") {
218
+ const lessImplPkg = implementation || "less";
219
+
220
+ try {
221
+ // eslint-disable-next-line import/no-dynamic-require, global-require
222
+ resolvedImplementation = require(lessImplPkg);
223
+ } catch (error) {
224
+ loaderContext.emitError(error); // eslint-disable-next-line consistent-return
225
+
226
+ return;
227
+ }
228
+ } // eslint-disable-next-line consistent-return
229
+
230
+
231
+ return resolvedImplementation;
228
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "less-loader",
3
- "version": "8.1.1",
3
+ "version": "10.0.1",
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,7 +30,7 @@
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",
33
+ "prepare": "husky install && npm run build",
34
34
  "release": "standard-version"
35
35
  },
36
36
  "files": [
@@ -44,29 +44,29 @@
44
44
  "klona": "^2.0.4"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/cli": "^7.13.14",
48
- "@babel/core": "^7.13.15",
49
- "@babel/preset-env": "^7.13.15",
50
- "@commitlint/cli": "^12.1.1",
51
- "@commitlint/config-conventional": "^12.1.1",
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",
52
52
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
53
- "babel-jest": "^26.6.3",
53
+ "babel-jest": "^27.0.2",
54
54
  "cross-env": "^7.0.3",
55
55
  "del": "^6.0.0",
56
- "del-cli": "^3.0.1",
57
- "eslint": "^7.24.0",
58
- "eslint-config-prettier": "^8.2.0",
59
- "eslint-plugin-import": "^2.22.1",
60
- "husky": "^4.3.8",
61
- "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",
62
62
  "less": "^4.1.1",
63
- "lint-staged": "^10.5.4",
63
+ "lint-staged": "^11.0.0",
64
64
  "memfs": "^3.2.2",
65
65
  "npm-run-all": "^4.1.5",
66
- "prettier": "^2.2.1",
67
- "standard-version": "^9.2.0",
68
- "strip-ansi": "^6.0.0",
69
- "webpack": "^5.33.2"
66
+ "prettier": "^2.3.1",
67
+ "standard-version": "^9.3.0",
68
+ "strip-ansi": "^7.0.0",
69
+ "webpack": "^5.39.1"
70
70
  },
71
71
  "keywords": [
72
72
  "webpack",
package/CHANGELOG.md DELETED
@@ -1,318 +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.1](https://github.com/webpack-contrib/less-loader/compare/v8.1.0...v8.1.1) (2021-04-15)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * deprecation warning ([#415](https://github.com/webpack-contrib/less-loader/issues/415)) ([87a4f25](https://github.com/webpack-contrib/less-loader/commit/87a4f25e2c8343ae2c75486749e57c2d10b1490d))
11
-
12
- ## [8.1.0](https://github.com/webpack-contrib/less-loader/compare/v8.0.0...v8.1.0) (2021-04-09)
13
-
14
-
15
- ### Features
16
-
17
- * 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))
18
-
19
- ## [8.0.0](https://github.com/webpack-contrib/less-loader/compare/v7.3.0...v8.0.0) (2021-02-01)
20
-
21
-
22
- ### Notes
23
-
24
- * using `~` is deprecated and can be removed from your code (**we recommend it**), but we still support it for historical reasons.
25
-
26
- Why you can removed it?
27
- 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).
28
-
29
- ### ⚠ BREAKING CHANGES
30
-
31
- * minimum supported `webpack` version is `5`
32
-
33
- ### Features
34
-
35
- * supported the [`resolve.byDependency`](https://webpack.js.org/configuration/resolve/#resolvebydependency) option, you can setup `{ resolve: { byDependency: { less: { mainFiles: ['custom', '...'] } } } }`
36
-
37
- ## [7.3.0](https://github.com/webpack-contrib/less-loader/compare/v7.2.1...v7.3.0) (2021-01-21)
38
-
39
-
40
- ### Features
41
-
42
- * added the `implementation` option ([84d957c](https://github.com/webpack-contrib/less-loader/commit/84d957cfe4fbd6c97619c647d0dd0917b99408ae))
43
-
44
- ### [7.2.1](https://github.com/webpack-contrib/less-loader/compare/v7.2.0...v7.2.1) (2020-12-28)
45
-
46
-
47
- ### Bug Fixes
48
-
49
- * errors from less ([#401](https://github.com/webpack-contrib/less-loader/issues/401)) ([ce31aca](https://github.com/webpack-contrib/less-loader/commit/ce31aca7aada70a8cc267449954ab38b642cd4ba))
50
-
51
- ## [7.2.0](https://github.com/webpack-contrib/less-loader/compare/v7.1.0...v7.2.0) (2020-12-23)
52
-
53
-
54
- ### Features
55
-
56
- * 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))
57
-
58
- ## [7.1.0](https://github.com/webpack-contrib/less-loader/compare/v7.0.2...v7.1.0) (2020-11-11)
59
-
60
-
61
- ### Features
62
-
63
- * 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))
64
-
65
- ### [7.0.2](https://github.com/webpack-contrib/less-loader/compare/v7.0.1...v7.0.2) (2020-10-09)
66
-
67
- ### Chore
68
-
69
- * update `schema-utils`
70
-
71
- ### [7.0.1](https://github.com/webpack-contrib/less-loader/compare/v7.0.0...v7.0.1) (2020-09-03)
72
-
73
-
74
- ### Bug Fixes
75
-
76
- * normalize `sources` in source maps ([877d99a](https://github.com/webpack-contrib/less-loader/commit/877d99a380deac92e07c41429a9b0c5f0bba2710))
77
-
78
- ## [7.0.0](https://github.com/webpack-contrib/less-loader/compare/v6.2.0...v7.0.0) (2020-08-25)
79
-
80
-
81
- ### ⚠ BREAKING CHANGES
82
-
83
- * move `less` to `peerDependencies`, the `implementation` option was removed
84
- * `prependData` and `appendData` option were removed in favor the `additionaldata` option
85
-
86
- ### Features
87
-
88
- * added `webpackImporter` option ([#377](https://github.com/webpack-contrib/less-loader/issues/377)) ([12dca5b](https://github.com/webpack-contrib/less-loader/commit/12dca5bb573740472cff8176b7aade184c773ebc))
89
- * 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))
90
- * added `additionaldata` option ([#374](https://github.com/webpack-contrib/less-loader/issues/374)) ([2785803](https://github.com/webpack-contrib/less-loader/commit/27858037a2e307fdf437604300f14c8233df4568))
91
-
92
- ## [6.2.0](https://github.com/webpack-contrib/less-loader/compare/v6.1.3...v6.2.0) (2020-07-03)
93
-
94
-
95
- ### Features
96
-
97
- * 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))
98
-
99
- ### [6.1.3](https://github.com/webpack-contrib/less-loader/compare/v6.1.2...v6.1.3) (2020-06-29)
100
-
101
-
102
- ### Bug Fixes
103
-
104
- * revert restrictions ([e758837](https://github.com/webpack-contrib/less-loader/commit/e75883706fc3d3bb2b6283a727a405216473362e))
105
-
106
- ### [6.1.2](https://github.com/webpack-contrib/less-loader/compare/v6.1.1...v6.1.2) (2020-06-22)
107
-
108
-
109
- ### Bug Fixes
110
-
111
- * ignore watch for remove URLs ([3946937](https://github.com/webpack-contrib/less-loader/commit/39469376e28cd0e38162f7bdf8935d343830a40e))
112
- * resolution logic ([2c3a23a](https://github.com/webpack-contrib/less-loader/commit/2c3a23a440cbdad1edb8b232864cb0233a266782))
113
- * resolve absolute and root relative imports ([3d01b82](https://github.com/webpack-contrib/less-loader/commit/3d01b82fae335d5d69d6290911e788debc732182))
114
-
115
- ### [6.1.1](https://github.com/webpack-contrib/less-loader/compare/v6.1.0...v6.1.1) (2020-06-11)
116
-
117
-
118
- ### Bug Fixes
119
-
120
- * do not rebuilt unmodified files on windows in watch mode ([6537a3d](https://github.com/webpack-contrib/less-loader/commit/6537a3d66559464af9b9a25f4bdda8691e8d9407))
121
-
122
- ## [6.1.0](https://github.com/webpack-contrib/less-loader/compare/v6.0.0...v6.1.0) (2020-05-07)
123
-
124
-
125
- ### Features
126
-
127
- * new `implementation` option ([#354](https://github.com/webpack-contrib/less-loader/issues/354)) ([d2de80f](https://github.com/webpack-contrib/less-loader/commit/d2de80f9fe6ee11e784260dbda960853ebd2449b))
128
-
129
-
130
- ### Bug Fixes
131
-
132
- * 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))
133
-
134
- ## [6.0.0](https://github.com/webpack-contrib/less-loader/compare/v5.0.0...v6.0.0) (2020-04-24)
135
-
136
-
137
- ### ⚠ BREAKING CHANGES
138
-
139
- * minimum supported Node.js version is `10.13`,
140
- * minimum support webpack version is `4`
141
- * `2` version of `less` is not supported anymore
142
- * using `3` versin of `less` by default, so you don't need to have `less` in your `package.json`, we already supply it
143
- * move less-specific options to the `lessOptions` option, please look at [README](https://github.com/webpack-contrib/less-loader#lessoptions)
144
-
145
-
146
- ### Features
147
-
148
- * the `paths` options now works with webpack resolver ([3931470](https://github.com/webpack-contrib/less-loader/commit/393147064672ace986ec84aca21f69f0ab819a9c))
149
- * 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))
150
- * added the `appendData` option ([#336](https://github.com/webpack-contrib/less-loader/issues/336)) ([fb94605](https://github.com/webpack-contrib/less-loader/commit/fb946051bb4d52a6f9a93fe40a8cd09a56a2c5f1))
151
- * added the `prependData` option ([#327](https://github.com/webpack-contrib/less-loader/issues/327)) ([9df8755](https://github.com/webpack-contrib/less-loader/commit/9df87554ee1ac57d2c32743049174da20e8a8a61))
152
- * support `less` and `style` fields in `package.json`
153
- * support `index.less` file for packages
154
-
155
- ### Bug Fixes
156
-
157
- * 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))
158
- * 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))
159
- * add webpack v5 support ([#317](https://github.com/webpack-contrib/less-loader/issues/317)) ([f0b42b4](https://github.com/webpack-contrib/less-loader/commit/f0b42b4e64dceed0bbb2557c0d88d1c36fe3e553))
160
- * 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))
161
- * fix a resolution for `@import 'package/file.ess';` and `@import './package/file.ess';`
162
-
163
-
164
- <a name="5.0.0"></a>
165
- # [5.0.0](https://github.com/webpack-contrib/less-loader/compare/v4.1.0...v5.0.0) (2019-04-29)
166
-
167
-
168
- ### Bug Fixes
169
-
170
- * 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))
171
-
172
-
173
- ### Chores
174
-
175
- * 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))
176
-
177
-
178
- ### Code Refactoring
179
-
180
- * remove deprecated compress option ([#283](https://github.com/webpack-contrib/less-loader/issues/283)) ([3d6e9e9](https://github.com/webpack-contrib/less-loader/commit/3d6e9e9))
181
-
182
-
183
- ### BREAKING CHANGES
184
-
185
- * remove deprecated compress option.
186
- * drop support for node < 6.9 and webpack < 4
187
-
188
-
189
-
190
- <a name="4.1.0"></a>
191
- # [4.1.0](https://github.com/webpack-contrib/less-loader/compare/v4.0.6...v4.1.0) (2018-03-09)
192
-
193
-
194
- ### Features
195
-
196
- * **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))
197
-
198
-
199
-
200
- <a name="4.0.6"></a>
201
- ## [4.0.6](https://github.com/webpack-contrib/less-loader/compare/v4.0.5...v4.0.6) (2018-02-27)
202
-
203
-
204
- ### Bug Fixes
205
-
206
- * **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))
207
-
208
-
209
-
210
- <a name="4.0.5"></a>
211
- ## [4.0.5](https://github.com/webpack-contrib/less-loader/compare/v4.0.4...v4.0.5) (2017-07-10)
212
-
213
-
214
- ### Chore
215
-
216
- * support `webpack@3` ([670ab18](https://github.com/webpack-contrib/less-loader/commit/670ab18))
217
-
218
-
219
- <a name="4.0.4"></a>
220
- ## [4.0.4](https://github.com/webpack-contrib/less-loader/compare/v4.0.3...v4.0.4) (2017-05-30)
221
-
222
-
223
- ### Bug Fixes
224
-
225
- * 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)
226
-
227
-
228
-
229
- <a name="4.0.3"></a>
230
- ## [4.0.3](https://github.com/webpack-contrib/less-loader/compare/v4.0.2...v4.0.3) (2017-03-30)
231
-
232
-
233
- ### Bug Fixes
234
-
235
- * sourcesContent missing in source maps ([df28035](https://github.com/webpack-contrib/less-loader/commit/df28035))
236
-
237
-
238
-
239
- <a name="4.0.2"></a>
240
- ## [4.0.2](https://github.com/webpack-contrib/less-loader/compare/v4.0.1...v4.0.2) (2017-03-21)
241
-
242
-
243
- ### Bug Fixes
244
-
245
- * Plugin.install is not a function ([f8ae245](https://github.com/webpack-contrib/less-loader/commit/f8ae245))
246
-
247
-
248
-
249
- <a name="4.0.1"></a>
250
- ## [4.0.1](https://github.com/webpack-contrib/less-loader/compare/v4.0.0...v4.0.1) (2017-03-21)
251
-
252
-
253
- ### Bug Fixes
254
-
255
- * 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)
256
-
257
-
258
-
259
- <a name="4.0.0"></a>
260
- # [4.0.0](https://github.com/webpack-contrib/less-loader/compare/v3.0.0...v4.0.0) (2017-03-20)
261
-
262
-
263
- ### Bug Fixes
264
-
265
- * error where not all files were watched ([53c90fc](https://github.com/webpack-contrib/less-loader/commit/53c90fc))
266
- * resolve alias ([98d4e63](https://github.com/webpack-contrib/less-loader/commit/98d4e63))
267
-
268
-
269
- ### Chores
270
-
271
- * **dependencies:** Update peer dependencies ([24a6f66](https://github.com/webpack-contrib/less-loader/commit/24a6f66))
272
-
273
-
274
- ### Features
275
-
276
- * **source-maps:** refactor source maps handling ([895044f](https://github.com/webpack-contrib/less-loader/commit/895044f))
277
- * allow user to choose between resolvers ([1d6e505](https://github.com/webpack-contrib/less-loader/commit/1d6e505))
278
- * improve formatting of error messages ([39772a5](https://github.com/webpack-contrib/less-loader/commit/39772a5))
279
- * make any file type importable ([d3022b8](https://github.com/webpack-contrib/less-loader/commit/d3022b8))
280
- * remove root option ([39ad4f8](https://github.com/webpack-contrib/less-loader/commit/39ad4f8))
281
-
282
-
283
- ### BREAKING CHANGES
284
-
285
- * If you've already configured your `resolve.alias` with a `.less` extension, you can now remove that wrong extension.
286
- * 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.
287
- * **dependencies:** Require webpack 2 as peer dependency
288
- * **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.
289
-
290
-
291
-
292
- Changelog
293
- ---------
294
-
295
- ### 3.0.0
296
-
297
- - **Breaking**: Remove node 0.10 and 0.12 support
298
- - **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
299
- - **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)
300
- - Reduce npm package size by using the [files](https://docs.npmjs.com/files/package.json#files) property in the `package.json`
301
-
302
-
303
- ### 2.2.3
304
-
305
- - Fix missing path information in source map [#73](https://github.com/webpack/less-loader/pull/73)
306
- - Add deprecation warning [#84](https://github.com/webpack/less-loader/issues/84)
307
-
308
- ### 2.2.2
309
-
310
- - 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)
311
-
312
- ### 2.2.1
313
-
314
- - Improve Readme
315
-
316
- ### 2.2.0
317
-
318
- - Added option to specify LESS plugins [#40](https://github.com/webpack/less-loader/pull/40)