less-loader 12.3.3 → 13.1.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.
@@ -0,0 +1,388 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.errorFactory = errorFactory;
7
+ exports.getLessImplementation = getLessImplementation;
8
+ exports.getLessOptions = getLessOptions;
9
+ exports.isUnsupportedUrl = isUnsupportedUrl;
10
+ exports.normalizeSourceMap = normalizeSourceMap;
11
+ var _nodePath = _interopRequireDefault(require("node:path"));
12
+ var _nodeUrl = _interopRequireDefault(require("node:url"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ /** @typedef {import("webpack").LoaderContext<LoaderOptions>} LoaderContext */
15
+ /** @typedef {import("less")} Less */
16
+
17
+ /** @typedef {Parameters<Less["render"]>[1]} LessOptions */
18
+ /** @typedef {NonNullable<LessOptions["plugins"]>[number]} LessPlugin */
19
+ /** @typedef {Less["FileManager"]} LessFileManager */
20
+ /** @typedef {InstanceType<Less["PluginManager"]>} PluginManager */
21
+ /** @typedef {InstanceType<LessFileManager>} LessFileManagerInstance */
22
+ /** @typedef {Parameters<InstanceType<LessFileManager>["loadFile"]>[2]} LoadFileOptions */
23
+ /** @typedef {Parameters<InstanceType<LessFileManager>["loadFile"]>[3]} Environment */
24
+ /** @typedef {Awaited<ReturnType<LessFileManagerInstance["loadFile"]>>} LoadFileResult */
25
+
26
+ /**
27
+ * @typedef {object} LoaderOptions
28
+ * @property {LessOptions | ((loaderContext: LoaderContext) => LessOptions)=} lessOptions less options
29
+ * @property {string | ((source: string, loaderContext: LoaderContext) => string | Promise<string>)=} additionalData additional data
30
+ * @property {boolean=} sourceMap true when need to generate source map, otherwise false
31
+ * @property {boolean | "only"=} webpackImporter true when need to use webpack importer, otherwise false
32
+ * @property {string | Less=} implementation implementation
33
+ * @property {boolean=} lessLogAsWarnOrErr true when need to log less warnings and errors as webpack warnings and errors
34
+ */
35
+
36
+ /**
37
+ * @typedef {object} SourceMap
38
+ * @property {string=} file file
39
+ * @property {string=} sourceRoot source root
40
+ * @property {string[]} sources sources
41
+ */
42
+
43
+ /**
44
+ * @typedef {Error & { type?: string, filename?: string, line?: number, column?: number, extract?: string[] }} LessError
45
+ */
46
+
47
+ const trailingSlash = /[/\\]$/;
48
+
49
+ // This somewhat changed in Less 3.x. Now the file name comes without the
50
+ // automatically added extension whereas the extension is passed in as `options.ext`.
51
+ // So, if the file name matches this regexp, we simply ignore the proposed extension.
52
+ const IS_SPECIAL_MODULE_IMPORT = /^~[^/]+$/;
53
+
54
+ // `[drive_letter]:\` + `\\[server]\[share_name]\`
55
+ const IS_NATIVE_WIN32_PATH = /^[a-z]:[/\\]|^\\\\/i;
56
+
57
+ // Examples:
58
+ // - ~package
59
+ // - ~package/
60
+ // - ~@org
61
+ // - ~@org/
62
+ // - ~@org/package
63
+ // - ~@org/package/
64
+ const IS_MODULE_IMPORT = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;
65
+ const MODULE_REQUEST_REGEX = /^[^?]*~/;
66
+
67
+ /**
68
+ * Creates a Less plugin that uses webpack's resolving engine that is provided by the loaderContext.
69
+ * @param {LoaderContext} loaderContext loader context
70
+ * @param {Less} implementation implementation
71
+ * @param {Promise<void>[]} pendingDependencyTasks pending dependency tasks
72
+ * @returns {LessPlugin} less plugin
73
+ */
74
+ function createWebpackLessPlugin(loaderContext, implementation, pendingDependencyTasks) {
75
+ const lessOptions = /** @type {LoaderOptions} */
76
+ loaderContext.getOptions();
77
+ const resolve = loaderContext.getResolve({
78
+ dependencyType: "less",
79
+ conditionNames: ["less", "style", "..."],
80
+ mainFields: ["less", "style", "main", "..."],
81
+ mainFiles: ["index", "..."],
82
+ extensions: [".less", ".css"],
83
+ preferRelative: true
84
+ });
85
+ class WebpackFileManager extends implementation.FileManager {
86
+ /**
87
+ * @param {string} filename filename
88
+ * @returns {boolean} true when filename is supported, otherwise false
89
+ */
90
+ supports(filename) {
91
+ if (filename[0] === "/" || IS_NATIVE_WIN32_PATH.test(filename)) {
92
+ return true;
93
+ }
94
+ if (this.isPathAbsolute(filename)) {
95
+ return false;
96
+ }
97
+ return true;
98
+ }
99
+
100
+ // Sync loading is used by `data-uri()` and any custom Less function
101
+ // (including those installed via `@plugin`). Webpack doesn't expose a
102
+ // sync resolver, so we fulfil the sync read by delegating to Less's
103
+ // default file manager (which can only handle native filesystem paths)
104
+ // and, in parallel, kick off an async webpack resolve so the loaded
105
+ // file is tracked as a webpack file dependency. Without this, webpack's
106
+ // persistent cache won't invalidate when a sync-loaded file changes.
107
+ // See https://github.com/webpack/less-loader/issues/492.
108
+ /**
109
+ * @returns {boolean} true when support sync, otherwise false
110
+ */
111
+ supportsSync() {
112
+ return true;
113
+ }
114
+
115
+ /**
116
+ * @param {string} filename filename
117
+ * @param {string} currentDirectory current directory
118
+ * @param {LoadFileOptions} options options
119
+ * @param {Environment} environment environment
120
+ * @returns {LoadFileResult} loaded file
121
+ */
122
+ loadFileSync(filename, currentDirectory, options, environment) {
123
+ // The default Less `loadFileSync` internally dispatches to
124
+ // `this.loadFile` with `options.syncImport = true`. Because we
125
+ // override `loadFile` (async), dynamic dispatch would land back in
126
+ // our async version and break the sync contract. Invoke the parent
127
+ // `loadFile` directly with the sync flag instead.
128
+ // @ts-expect-error bad types in less
129
+ const result = /** @type {LoadFileResult} */
130
+ super.loadFile(filename, currentDirectory, {
131
+ ...options,
132
+ syncImport: true
133
+ }, environment);
134
+ if (result && result.filename) {
135
+ loaderContext.addDependency(_nodePath.default.normalize(_nodePath.default.isAbsolute(result.filename) ? result.filename : _nodePath.default.resolve(currentDirectory || ".", result.filename)));
136
+ }
137
+
138
+ // Also try to resolve via webpack so aliases / custom resolvers can
139
+ // contribute dependencies. The resolved content is discarded - we
140
+ // only need the file path to track as a dependency.
141
+ pendingDependencyTasks.push(this.resolveFilename(filename, currentDirectory).then(resolved => {
142
+ const absoluteFilename = _nodePath.default.isAbsolute(resolved) ? resolved : _nodePath.default.resolve(".", resolved);
143
+ loaderContext.addDependency(_nodePath.default.normalize(absoluteFilename));
144
+ }).catch(() => {
145
+ // Webpack may legitimately fail to resolve paths that Less's
146
+ // default sync manager handled (e.g. node-style relative
147
+ // lookups). The sync result above is what Less consumes, so
148
+ // ignore the async failure.
149
+ }));
150
+ return result;
151
+ }
152
+
153
+ /**
154
+ * @param {string} filename filename
155
+ * @param {string} currentDirectory current directory
156
+ * @returns {Promise<string>} resolved filename
157
+ */
158
+ async resolveFilename(filename, currentDirectory) {
159
+ // Less is giving us trailing slashes, but the context should have no trailing slash
160
+ const context = currentDirectory.replace(trailingSlash, "");
161
+ let request = filename;
162
+
163
+ // A `~` makes the url an module
164
+ if (MODULE_REQUEST_REGEX.test(filename)) {
165
+ request = request.replace(MODULE_REQUEST_REGEX, "");
166
+ }
167
+ if (IS_MODULE_IMPORT.test(filename)) {
168
+ request = request[request.length - 1] === "/" ? request : `${request}/`;
169
+ }
170
+ return this.resolveRequests(context, [...new Set([request, filename])]);
171
+ }
172
+
173
+ /**
174
+ * @param {string} context context
175
+ * @param {string[]} possibleRequests possible requests
176
+ * @returns {Promise<string>} resolved requests
177
+ */
178
+ async resolveRequests(context, possibleRequests) {
179
+ if (possibleRequests.length === 0) {
180
+ throw new Error("No possible requests to resolve");
181
+ }
182
+ let result;
183
+ try {
184
+ result = await resolve(context, possibleRequests[0]);
185
+ } catch (error) {
186
+ const [, ...tailPossibleRequests] = possibleRequests;
187
+ if (tailPossibleRequests.length === 0) {
188
+ throw error;
189
+ }
190
+ result = await this.resolveRequests(context, tailPossibleRequests);
191
+ }
192
+ return result;
193
+ }
194
+
195
+ /**
196
+ * @param {string} filename filename
197
+ * @param {string} currentDirectory current directory
198
+ * @param {LoadFileOptions} options options
199
+ * @param {Environment} environment environment
200
+ * @returns {Promise<LoadFileResult>} loaded file
201
+ */
202
+ async loadFile(filename, currentDirectory, options, environment) {
203
+ let result;
204
+ try {
205
+ if (IS_SPECIAL_MODULE_IMPORT.test(filename) || lessOptions.webpackImporter === "only") {
206
+ const error = /** @type {LessError} */new Error("Next");
207
+ error.type = "Next";
208
+ throw error;
209
+ }
210
+ result = await super.loadFile(filename, currentDirectory, options, environment);
211
+ } catch (error) {
212
+ const lessError = /** @type {LessError} */error;
213
+ if (lessError.type !== "File" && lessError.type !== "Next") {
214
+ throw error;
215
+ }
216
+ try {
217
+ result = await this.resolveFilename(filename, currentDirectory);
218
+ } catch (err) {
219
+ lessError.message = `Less resolver error:\n${lessError.message}\n\n` + `Webpack resolver error details:\n${ /** @type {{ details: string }} */err.details}\n\n` + `Webpack resolver error missing:\n${ /** @type {{ missing: string }} */err.missing}\n\n`;
220
+ throw error;
221
+ }
222
+ loaderContext.addDependency(result);
223
+ return super.loadFile(result, currentDirectory, options, environment);
224
+ }
225
+ const absoluteFilename = _nodePath.default.isAbsolute(result.filename) ? result.filename : _nodePath.default.resolve(".", result.filename);
226
+ loaderContext.addDependency(_nodePath.default.normalize(absoluteFilename));
227
+ return result;
228
+ }
229
+ }
230
+ return {
231
+ /**
232
+ * @param {Less} less less
233
+ * @param {PluginManager} pluginManager plugin manager
234
+ */
235
+ install(less, pluginManager) {
236
+ pluginManager.addFileManager(new WebpackFileManager());
237
+ },
238
+ minVersion: [3, 0, 0]
239
+ };
240
+ }
241
+
242
+ /**
243
+ * Get the `less` options from the loader context and normalizes its values
244
+ * @param {LoaderContext} loaderContext loader context
245
+ * @param {LoaderOptions} loaderOptions loader options
246
+ * @param {Less} implementation implementation
247
+ * @returns {{ lessOptions: LessOptions, pendingDependencyTasks: Promise<void>[] }} implementation and pending tasks
248
+ */
249
+ function getLessOptions(loaderContext, loaderOptions, implementation) {
250
+ const options = typeof loaderOptions.lessOptions === "function" ? loaderOptions.lessOptions(loaderContext) || {} : loaderOptions.lessOptions || {};
251
+
252
+ /** @type {LessOptions} */
253
+ const lessOptions = {
254
+ // @ts-expect-error bad types
255
+ relativeUrls: true,
256
+ // We need to set the filename because otherwise our WebpackFileManager will receive an undefined path for the entry;
257
+ // a `data:` resource has no path of its own, so it reads as a file in the loader's context
258
+ filename: loaderContext.resourcePath.startsWith("data:") ? _nodePath.default.join(loaderContext.context, "stdin.less") : loaderContext.resourcePath,
259
+ ...options
260
+ };
261
+
262
+ // Collects async dependency-resolution promises kicked off from
263
+ // synchronous Less file loads (e.g. `data-uri()`, `@plugin`). The loader
264
+ // awaits these before completing so webpack's dependency snapshot is
265
+ // accurate.
266
+ /** @type {Promise<void>[]} */
267
+ const pendingDependencyTasks = [];
268
+
269
+ /** @type {LessPlugin[]} */
270
+ const plugins = [...(lessOptions.plugins || [])];
271
+ const shouldUseWebpackImporter = typeof loaderOptions.webpackImporter === "boolean" || loaderOptions.webpackImporter === "only" ? loaderOptions.webpackImporter : true;
272
+ if (shouldUseWebpackImporter) {
273
+ plugins.unshift(createWebpackLessPlugin(loaderContext, implementation, pendingDependencyTasks));
274
+ }
275
+ plugins.unshift({
276
+ /**
277
+ * @param {Less} less less
278
+ * @param {PluginManager} pluginManager plugin manager
279
+ */
280
+ install(less, pluginManager) {
281
+ // @ts-expect-error to provide loader context into plugin
282
+ pluginManager.webpackLoaderContext = loaderContext;
283
+ // @ts-expect-error to reset it after execution
284
+ lessOptions.pluginManager = pluginManager;
285
+ }
286
+ });
287
+ lessOptions.plugins = plugins;
288
+ return {
289
+ lessOptions,
290
+ pendingDependencyTasks
291
+ };
292
+ }
293
+
294
+ /**
295
+ * @param {string} url url
296
+ * @returns {boolean} true when url is unsupported, otherwise false
297
+ */
298
+ function isUnsupportedUrl(url) {
299
+ // Is Windows path
300
+ if (IS_NATIVE_WIN32_PATH.test(url)) {
301
+ return false;
302
+ }
303
+
304
+ // Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
305
+ // Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
306
+ return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
307
+ }
308
+
309
+ /**
310
+ * @param {SourceMap} map map
311
+ * @returns {SourceMap} normalized source map
312
+ */
313
+ function normalizeSourceMap(map) {
314
+ const newMap = map;
315
+
316
+ // map.file is an optional property that provides the output filename.
317
+ // Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.
318
+
319
+ delete newMap.file;
320
+ newMap.sourceRoot = "";
321
+
322
+ // `less` returns POSIX paths, that's why we need to transform them back to native paths.
323
+
324
+ newMap.sources = newMap.sources.map(source => _nodePath.default.normalize(source));
325
+ return newMap;
326
+ }
327
+
328
+ /**
329
+ * @param {string} specifier specifier
330
+ * @returns {string} resolved specifier
331
+ */
332
+ function normalizeImportSpecifier(specifier) {
333
+ if (specifier.startsWith("file:")) {
334
+ return specifier;
335
+ }
336
+ if (_nodePath.default.isAbsolute(specifier)) {
337
+ return _nodeUrl.default.pathToFileURL(specifier).href;
338
+ }
339
+ return specifier;
340
+ }
341
+
342
+ /**
343
+ * @param {LoaderContext} loaderContext loader context
344
+ * @param {string | Less | undefined} implementation implementation
345
+ * @returns {Promise<Less>} less implementation
346
+ */
347
+ async function getLessImplementation(loaderContext, implementation) {
348
+ let resolvedImplementation = implementation;
349
+ if (!implementation || typeof implementation === "string") {
350
+ const lessImplPkg = implementation || "less";
351
+ const imported = await import(normalizeImportSpecifier(lessImplPkg));
352
+ resolvedImplementation = imported.default ?? imported;
353
+ }
354
+ return /** @type {Less} */resolvedImplementation;
355
+ }
356
+
357
+ /**
358
+ * @param {LessError} error error
359
+ * @returns {string[]} file excerpt
360
+ */
361
+ function getFileExcerptIfPossible(error) {
362
+ if (typeof error.extract === "undefined") {
363
+ return [];
364
+ }
365
+ const excerpt = error.extract.slice(0, 2);
366
+ const column = Math.max(/** @type {number} */error.column - 1, 0);
367
+ if (typeof excerpt[0] === "undefined") {
368
+ excerpt.shift();
369
+ }
370
+ excerpt.push(`${" ".repeat(column)}^`);
371
+ return excerpt;
372
+ }
373
+
374
+ /**
375
+ * @param {LessError} error error
376
+ * @returns {Error} built error
377
+ */
378
+ function errorFactory(error) {
379
+ const message = ["\n", ...getFileExcerptIfPossible(error), error.message.charAt(0).toUpperCase() + error.message.slice(1), error.filename ? ` Error in ${_nodePath.default.normalize(error.filename)} (line ${error.line}, column ${error.column})` : ""].join("\n");
380
+ const obj = /** @type {Error & { stack: string | null }} */
381
+ new Error(message, {
382
+ cause: error
383
+ });
384
+
385
+ // @ts-expect-error avoid extra stack for less
386
+ obj.stack = null;
387
+ return obj;
388
+ }
@@ -0,0 +1,134 @@
1
+ import path from "node:path";
2
+ import schema from "./options.json" with { type: "json" };
3
+ import { errorFactory, getLessImplementation, getLessOptions, isUnsupportedUrl, normalizeSourceMap } from "./utils.js";
4
+
5
+ /** @typedef {import("webpack").LoaderContext<LoaderOptions>} LoaderContext */
6
+ /** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
7
+ /** @typedef {import("./utils.js").LoaderOptions} LoaderOptions */
8
+ /** @typedef {import("./utils.js").LessError} LessError */
9
+ /** @typedef {import("./utils.js").SourceMap} SourceMap */
10
+
11
+ /**
12
+ * Webpack loader that compiles Less to CSS.
13
+ * @this {LoaderContext}
14
+ * @param {string} content content
15
+ * @returns {Promise<void>} loader result
16
+ */
17
+ async function lessLoader(content) {
18
+ const options = this.getOptions(/** @type {Schema} */schema);
19
+ const callback = this.async();
20
+ let implementation;
21
+ try {
22
+ implementation = await getLessImplementation(this, options.implementation);
23
+ } catch (error) {
24
+ callback(/** @type {Error} */error);
25
+ return;
26
+ }
27
+ if (!implementation) {
28
+ callback(new Error(`The Less implementation "${options.implementation}" not found`));
29
+ return;
30
+ }
31
+ const {
32
+ lessOptions,
33
+ pendingDependencyTasks
34
+ } = getLessOptions(this, options, implementation);
35
+ const useSourceMap = typeof options.sourceMap === "boolean" ? options.sourceMap : this.sourceMap;
36
+ if (useSourceMap) {
37
+ lessOptions.sourceMap = {
38
+ sourceMapBasepath: "",
39
+ outputSourceFiles: true,
40
+ // @ts-expect-error bad types
41
+ disableSourcemapAnnotation: true
42
+ };
43
+ }
44
+ let data = content;
45
+ if (typeof options.additionalData !== "undefined") {
46
+ data = typeof options.additionalData === "function" ? `${await options.additionalData(data, this)}` : `${options.additionalData}\n${data}`;
47
+ }
48
+ const logger = this.getLogger("less-loader");
49
+ const loaderContext = this;
50
+ const lessLogAsWarnOrErr = options.lessLogAsWarnOrErr !== false;
51
+ const loggerListener = {
52
+ /** @param {string} message message */
53
+ error(message) {
54
+ if (lessLogAsWarnOrErr) {
55
+ loaderContext.emitError(new Error(message));
56
+ } else {
57
+ logger.error(message);
58
+ }
59
+ },
60
+ /** @param {string} message message */
61
+ warn(message) {
62
+ if (lessLogAsWarnOrErr) {
63
+ loaderContext.emitWarning(new Error(message));
64
+ } else {
65
+ logger.warn(message);
66
+ }
67
+ },
68
+ /** @param {string} message message */
69
+ info(message) {
70
+ logger.log(message);
71
+ },
72
+ /** @param {string} message message */
73
+ debug(message) {
74
+ logger.debug(message);
75
+ }
76
+ };
77
+
78
+ // @ts-expect-error bad types
79
+ implementation.logger.addListener(loggerListener);
80
+ let result;
81
+ try {
82
+ result = await implementation.render(data, lessOptions);
83
+ } catch (error) {
84
+ const lessError = /** @type {LessError} */error;
85
+ if (lessError.filename) {
86
+ // `less` returns forward slashes on windows when `webpack` resolver return an absolute windows path in `WebpackFileManager`
87
+ // Ref: https://github.com/webpack/less-loader/issues/357
88
+ this.addDependency(path.normalize(lessError.filename));
89
+ }
90
+
91
+ // Wait for any pending sync-load dependency tracking so the failed
92
+ // build still snapshots the files it touched.
93
+ await Promise.all(pendingDependencyTasks);
94
+ callback(errorFactory(lessError));
95
+ return;
96
+ } finally {
97
+ // Fix memory leaks in `less`
98
+ // @ts-expect-error bad types
99
+ implementation.logger.removeListener(loggerListener);
100
+
101
+ // @ts-expect-error we need it to reset loader context
102
+ delete lessOptions.pluginManager.webpackLoaderContext;
103
+ // @ts-expect-error we need it to reset loader context
104
+ delete lessOptions.pluginManager;
105
+ }
106
+
107
+ // Ensure dependencies for any synchronously loaded resources (e.g.
108
+ // `data-uri()`, `@plugin`) are tracked before the loader completes.
109
+ await Promise.all(pendingDependencyTasks);
110
+ const {
111
+ css,
112
+ imports
113
+ } = result;
114
+ for (const item of imports) {
115
+ if (isUnsupportedUrl(item)) {
116
+ continue;
117
+ }
118
+
119
+ // `less` return forward slashes on windows when `webpack` resolver return an absolute windows path in `WebpackFileManager`
120
+ // Ref: https://github.com/webpack/less-loader/issues/357
121
+ const normalizedItem = path.normalize(item);
122
+
123
+ // Custom `importer` can return only `contents` so item will be relative
124
+ if (path.isAbsolute(normalizedItem)) {
125
+ this.addDependency(normalizedItem);
126
+ }
127
+ }
128
+ let map = typeof result.map === "string" ? JSON.parse(result.map) : result.map;
129
+ if (map && useSourceMap) {
130
+ map = normalizeSourceMap(map);
131
+ }
132
+ callback(null, css, map);
133
+ }
134
+ export default lessLoader;
@@ -0,0 +1,67 @@
1
+ {
2
+ "title": "Less Loader options",
3
+ "type": "object",
4
+ "properties": {
5
+ "lessOptions": {
6
+ "description": "Options to pass through to `Less`.",
7
+ "link": "https://github.com/webpack/less-loader#lessoptions",
8
+ "anyOf": [
9
+ {
10
+ "type": "object",
11
+ "additionalProperties": true
12
+ },
13
+ {
14
+ "instanceof": "Function"
15
+ }
16
+ ]
17
+ },
18
+ "additionalData": {
19
+ "description": "Prepends/Appends `Less` code to the actual entry file.",
20
+ "link": "https://github.com/webpack/less-loader#additionalData",
21
+ "anyOf": [
22
+ {
23
+ "type": "string"
24
+ },
25
+ {
26
+ "instanceof": "Function"
27
+ }
28
+ ]
29
+ },
30
+ "sourceMap": {
31
+ "description": "Enables/Disables generation of source maps.",
32
+ "link": "https://github.com/webpack/less-loader#sourcemap",
33
+ "type": "boolean"
34
+ },
35
+ "webpackImporter": {
36
+ "description": "Enables/Disables default `webpack` importer.",
37
+ "link": "https://github.com/webpack/less-loader#webpackimporter",
38
+ "anyOf": [
39
+ {
40
+ "type": "boolean"
41
+ },
42
+ {
43
+ "type": "string",
44
+ "enum": ["only"]
45
+ }
46
+ ]
47
+ },
48
+ "implementation": {
49
+ "description": "The implementation of the `Less` to be used.",
50
+ "link": "https://github.com/webpack/less-loader#implementation",
51
+ "anyOf": [
52
+ {
53
+ "type": "string"
54
+ },
55
+ {
56
+ "type": "object"
57
+ }
58
+ ]
59
+ },
60
+ "lessLogAsWarnOrErr": {
61
+ "description": "Less warnings and errors will be webpack warnings or errors.",
62
+ "link": "https://github.com/webpack/less-loader#lesslogaswarnorerr",
63
+ "type": "boolean"
64
+ }
65
+ },
66
+ "additionalProperties": false
67
+ }
@@ -0,0 +1 @@
1
+ {"type":"module"}