less-loader 12.3.1 → 12.3.2

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/dist/index.js CHANGED
@@ -13,7 +13,7 @@ async function lessLoader(source) {
13
13
  const callback = this.async();
14
14
  let implementation;
15
15
  try {
16
- implementation = (0, _utils.getLessImplementation)(this, options.implementation);
16
+ implementation = await (0, _utils.getLessImplementation)(this, options.implementation);
17
17
  } catch (error) {
18
18
  callback(error);
19
19
  return;
@@ -26,7 +26,9 @@ async function lessLoader(source) {
26
26
  const useSourceMap = typeof options.sourceMap === "boolean" ? options.sourceMap : this.sourceMap;
27
27
  if (useSourceMap) {
28
28
  lessOptions.sourceMap = {
29
- outputSourceFiles: true
29
+ sourceMapBasepath: "",
30
+ outputSourceFiles: true,
31
+ disableSourcemapAnnotation: true
30
32
  };
31
33
  }
32
34
  let data = source;
@@ -97,7 +99,7 @@ async function lessLoader(source) {
97
99
  }
98
100
  let map = typeof result.map === "string" ? JSON.parse(result.map) : result.map;
99
101
  if (map && useSourceMap) {
100
- map = (0, _utils.normalizeSourceMap)(map, this.rootContext);
102
+ map = (0, _utils.normalizeSourceMap)(map);
101
103
  }
102
104
  callback(null, css, map);
103
105
  }
package/dist/utils.js CHANGED
@@ -181,16 +181,15 @@ function normalizeSourceMap(map) {
181
181
  delete newMap.file;
182
182
  newMap.sourceRoot = "";
183
183
 
184
- // `less` returns POSIX paths, that's why we need to transform them back to native paths.
185
-
184
+ // `less` (old versions) returns POSIX paths, that's why we need to transform them back to native paths.
186
185
  newMap.sources = newMap.sources.map(source => _nodePath.default.normalize(source));
187
186
  return newMap;
188
187
  }
189
- function getLessImplementation(loaderContext, implementation) {
188
+ async function getLessImplementation(loaderContext, implementation) {
190
189
  let resolvedImplementation = implementation;
191
190
  if (!implementation || typeof implementation === "string") {
192
191
  const lessImplPkg = implementation || "less";
193
- resolvedImplementation = require(lessImplPkg);
192
+ resolvedImplementation = (await import(lessImplPkg)).default;
194
193
  }
195
194
  return resolvedImplementation;
196
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "less-loader",
3
- "version": "12.3.1",
3
+ "version": "12.3.2",
4
4
  "description": "A Less loader for webpack. Compiles Less to CSS.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -38,7 +38,7 @@
38
38
  "fix:js": "npm run lint:js -- --fix",
39
39
  "fix:prettier": "npm run lint:prettier -- --write",
40
40
  "fix": "npm-run-all -l fix:js fix:prettier",
41
- "test:only": "cross-env NODE_ENV=test jest",
41
+ "test:only": "node --experimental-vm-modules node_modules/jest-cli/bin/jest.js",
42
42
  "test:watch": "npm run test:only -- --watch",
43
43
  "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
44
44
  "pretest": "npm run lint",
@@ -52,26 +52,16 @@
52
52
  "@babel/preset-env": "^7.24.7",
53
53
  "@commitlint/cli": "^18.6.1",
54
54
  "@commitlint/config-conventional": "^18.6.2",
55
- "@eslint/js": "^9.32.0",
56
- "@eslint/markdown": "^7.1.0",
57
- "@stylistic/eslint-plugin": "^5.2.2",
58
55
  "babel-jest": "^30.0.0",
59
56
  "cross-env": "^7.0.3",
60
57
  "cspell": "^8.10.0",
61
58
  "del": "^7.1.0",
62
59
  "del-cli": "^5.1.0",
63
60
  "eslint": "^9.32.0",
64
- "eslint-config-prettier": "^10.1.8",
65
61
  "eslint-config-webpack": "^4.5.1",
66
- "eslint-plugin-import": "^2.32.0",
67
- "eslint-plugin-jest": "^29.0.1",
68
- "eslint-plugin-n": "^17.21.1",
69
- "eslint-plugin-prettier": "^5.5.3",
70
- "eslint-plugin-unicorn": "^60.0.0",
71
- "globals": "^16.3.0",
72
62
  "husky": "^9.1.3",
73
63
  "jest": "^30.0.0",
74
- "less": "^4.2.0",
64
+ "less": "^4.6.2",
75
65
  "less-plugin-glob": "^3.0.0",
76
66
  "lint-staged": "^15.2.7",
77
67
  "memfs": "^4.9.3",
@@ -79,7 +69,6 @@
79
69
  "prettier": "^3.3.2",
80
70
  "standard-version": "^9.3.1",
81
71
  "strip-ansi": "^7.1.0",
82
- "typescript-eslint": "^8.38.0",
83
72
  "webpack": "^5.92.1"
84
73
  },
85
74
  "peerDependencies": {