diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
| commit | 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch) | |
| tree | 4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@ampproject/remapping/dist/remapping.umd.js | |
| parent | 1368909b3cd552dbb0d12d5863c597f5be46177d (diff) | |
updated node_modules
Diffstat (limited to 'node_modules/@ampproject/remapping/dist/remapping.umd.js')
| -rw-r--r-- | node_modules/@ampproject/remapping/dist/remapping.umd.js | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/node_modules/@ampproject/remapping/dist/remapping.umd.js b/node_modules/@ampproject/remapping/dist/remapping.umd.js index e292d4c3..6b7b3bb5 100644 --- a/node_modules/@ampproject/remapping/dist/remapping.umd.js +++ b/node_modules/@ampproject/remapping/dist/remapping.umd.js @@ -4,17 +4,18 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remapping = factory(global.traceMapping, global.genMapping)); })(this, (function (traceMapping, genMapping) { 'use strict'; - const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null); + const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); const EMPTY_SOURCES = []; - function SegmentObject(source, line, column, name, content) { - return { source, line, column, name, content }; + function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; } - function Source(map, sources, source, content) { + function Source(map, sources, source, content, ignore) { return { map, sources, source, content, + ignore, }; } /** @@ -22,14 +23,14 @@ * (which may themselves be SourceMapTrees). */ function MapSource(map, sources) { - return Source(map, sources, '', null); + return Source(map, sources, '', null, false); } /** * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive * segment tracing ends at the `OriginalSource`. */ - function OriginalSource(source, content) { - return Source(null, EMPTY_SOURCES, source, content); + function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); } /** * traceMappings is only called on the root level SourceMapTree, and begins the process of @@ -58,10 +59,12 @@ if (traced == null) continue; } - const { column, line, name, content, source } = traced; + const { column, line, name, content, source, ignore } = traced; genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name); if (source && content != null) genMapping.setSourceContent(gen, source, content); + if (ignore) + genMapping.setIgnore(gen, source, true); } } return gen; @@ -72,7 +75,7 @@ */ function originalPositionFor(source, line, column, name) { if (!source.map) { - return SegmentObject(source.source, line, column, name, source.content); + return SegmentObject(source.source, line, column, name, source.content, source.ignore); } const segment = traceMapping.traceSegment(source.map, line, column); // If we couldn't find a segment, then this doesn't exist in the sourcemap. @@ -117,7 +120,7 @@ return tree; } function build(map, loader, importer, importerDepth) { - const { resolvedSources, sourcesContent } = map; + const { resolvedSources, sourcesContent, ignoreList } = map; const depth = importerDepth + 1; const children = resolvedSources.map((sourceFile, i) => { // The loading context gives the loader more information about why this file is being loaded @@ -129,20 +132,22 @@ depth, source: sourceFile || '', content: undefined, + ignore: undefined, }; // Use the provided loader callback to retrieve the file's sourcemap. // TODO: We should eventually support async loading of sourcemap files. const sourceMap = loader(ctx.source, ctx); - const { source, content } = ctx; + const { source, content, ignore } = ctx; // If there is a sourcemap, then we need to recurse into it to load its source files. if (sourceMap) return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth); - // Else, it's an an unmodified source file. + // Else, it's an unmodified source file. // The contents of this unmodified source file can be overridden via the loader context, // allowing it to be explicitly null or a string. If it remains undefined, we fall back to // the importing sourcemap's `sourcesContent` field. const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; - return OriginalSource(source, sourceContent); + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); }); return MapSource(map, children); } @@ -158,6 +163,7 @@ this.file = out.file; this.mappings = out.mappings; this.names = out.names; + this.ignoreList = out.ignoreList; this.sourceRoot = out.sourceRoot; this.sources = out.sources; if (!options.excludeContent) { |
