* @param {SourceMap} map map * @returns {SourceMap} normalized source map
(map)
| 375 | * @returns {SourceMap} normalized source map |
| 376 | */ |
| 377 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…