MCPcopy Create free account
hub / github.com/webpack/less-loader / normalizeSourceMap

Function normalizeSourceMap

src/utils.js:377–392  ·  view source on GitHub ↗

* @param {SourceMap} map map * @returns {SourceMap} normalized source map

(map)

Source from the content-addressed store, hash-verified

375 * @returns {SourceMap} normalized source map
376 */
377function normalizeSourceMap(map) {
378 const newMap = map;
379
380 // map.file is an optional property that provides the output filename.
381 // Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.
382
383 delete newMap.file;
384
385 newMap.sourceRoot = "";
386
387 // `less` returns POSIX paths, that's why we need to transform them back to native paths.
388
389 newMap.sources = newMap.sources.map((source) => path.normalize(source));
390
391 return newMap;
392}
393
394/**
395 * @param {string} specifier specifier

Callers 1

lessLoaderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…