rollup 3.27.2 → 3.28.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.
- package/dist/bin/rollup +2 -2
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +90 -27
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +4 -4
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +90 -27
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch-proxy.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/bin/rollup
CHANGED
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.28.0
|
|
4
|
+
Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
|
|
|
15
15
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
16
16
|
import * as tty from 'tty';
|
|
17
17
|
|
|
18
|
-
var version$1 = "3.
|
|
18
|
+
var version$1 = "3.28.0";
|
|
19
19
|
|
|
20
20
|
const comma = ','.charCodeAt(0);
|
|
21
21
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -13217,12 +13217,82 @@ var BuildPhase;
|
|
|
13217
13217
|
BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
|
|
13218
13218
|
})(BuildPhase || (BuildPhase = {}));
|
|
13219
13219
|
|
|
13220
|
+
const sourceMapCache = new WeakMap();
|
|
13221
|
+
/**
|
|
13222
|
+
* This clears the decoded array and falls back to the encoded string form.
|
|
13223
|
+
* Sourcemap mappings arrays can be very large and holding on to them for longer
|
|
13224
|
+
* than is necessary leads to poor heap utilization.
|
|
13225
|
+
*/
|
|
13226
|
+
function resetCacheToEncoded(cache) {
|
|
13227
|
+
if (cache.encodedMappings === undefined && cache.decodedMappings) {
|
|
13228
|
+
cache.encodedMappings = encode(cache.decodedMappings);
|
|
13229
|
+
}
|
|
13230
|
+
cache.decodedMappings = undefined;
|
|
13231
|
+
}
|
|
13232
|
+
function resetSourcemapCache(map, sourcemapChain) {
|
|
13233
|
+
if (map) {
|
|
13234
|
+
const cache = sourceMapCache.get(map);
|
|
13235
|
+
if (cache) {
|
|
13236
|
+
resetCacheToEncoded(cache);
|
|
13237
|
+
}
|
|
13238
|
+
}
|
|
13239
|
+
if (!sourcemapChain) {
|
|
13240
|
+
return;
|
|
13241
|
+
}
|
|
13242
|
+
for (const map of sourcemapChain) {
|
|
13243
|
+
if (map.missing)
|
|
13244
|
+
continue;
|
|
13245
|
+
resetSourcemapCache(map);
|
|
13246
|
+
}
|
|
13247
|
+
}
|
|
13248
|
+
function decodedSourcemap(map) {
|
|
13249
|
+
if (!map)
|
|
13250
|
+
return null;
|
|
13251
|
+
if (typeof map === 'string') {
|
|
13252
|
+
map = JSON.parse(map);
|
|
13253
|
+
}
|
|
13254
|
+
if (!map.mappings) {
|
|
13255
|
+
return {
|
|
13256
|
+
mappings: [],
|
|
13257
|
+
names: [],
|
|
13258
|
+
sources: [],
|
|
13259
|
+
version: 3
|
|
13260
|
+
};
|
|
13261
|
+
}
|
|
13262
|
+
const originalMappings = map.mappings;
|
|
13263
|
+
const isAlreadyDecoded = Array.isArray(originalMappings);
|
|
13264
|
+
const cache = {
|
|
13265
|
+
decodedMappings: isAlreadyDecoded ? originalMappings : undefined,
|
|
13266
|
+
encodedMappings: isAlreadyDecoded ? undefined : originalMappings
|
|
13267
|
+
};
|
|
13268
|
+
const decodedMap = {
|
|
13269
|
+
...map,
|
|
13270
|
+
// By moving mappings behind an accessor, we can avoid unneeded computation for cases
|
|
13271
|
+
// where the mappings field is never actually accessed. This appears to greatly reduce
|
|
13272
|
+
// the overhead of sourcemap decoding in terms of both compute time and memory usage.
|
|
13273
|
+
get mappings() {
|
|
13274
|
+
if (cache.decodedMappings) {
|
|
13275
|
+
return cache.decodedMappings;
|
|
13276
|
+
}
|
|
13277
|
+
// If decodedMappings doesn't exist then encodedMappings should.
|
|
13278
|
+
// The only scenario where cache.encodedMappings should be undefined is if the map
|
|
13279
|
+
// this was constructed from was already decoded, or if mappings was set to a new
|
|
13280
|
+
// decoded string. In either case, this line shouldn't get hit.
|
|
13281
|
+
cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : [];
|
|
13282
|
+
cache.encodedMappings = undefined;
|
|
13283
|
+
return cache.decodedMappings;
|
|
13284
|
+
}
|
|
13285
|
+
};
|
|
13286
|
+
sourceMapCache.set(decodedMap, cache);
|
|
13287
|
+
return decodedMap;
|
|
13288
|
+
}
|
|
13289
|
+
|
|
13220
13290
|
function getId(m) {
|
|
13221
13291
|
return m.id;
|
|
13222
13292
|
}
|
|
13223
13293
|
|
|
13224
13294
|
function getOriginalLocation(sourcemapChain, location) {
|
|
13225
|
-
const filteredSourcemapChain = sourcemapChain.filter((sourcemap) =>
|
|
13295
|
+
const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !sourcemap.missing);
|
|
13226
13296
|
traceSourcemap: while (filteredSourcemapChain.length > 0) {
|
|
13227
13297
|
const sourcemap = filteredSourcemapChain.pop();
|
|
13228
13298
|
const line = sourcemap.mappings[location.line - 1];
|
|
@@ -13920,8 +13990,13 @@ class Module {
|
|
|
13920
13990
|
timeStart('generate ast', 3);
|
|
13921
13991
|
this.info.code = code;
|
|
13922
13992
|
this.originalCode = originalCode;
|
|
13923
|
-
|
|
13924
|
-
|
|
13993
|
+
// We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't
|
|
13994
|
+
// have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the
|
|
13995
|
+
// RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap`
|
|
13996
|
+
this.originalSourcemap = decodedSourcemap(originalSourcemap);
|
|
13997
|
+
this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing));
|
|
13998
|
+
// If coming from cache and this value is already fully decoded, we want to re-encode here to save memory.
|
|
13999
|
+
resetSourcemapCache(this.originalSourcemap, this.sourcemapChain);
|
|
13925
14000
|
if (transformFiles) {
|
|
13926
14001
|
this.transformFiles = transformFiles;
|
|
13927
14002
|
}
|
|
@@ -15676,7 +15751,8 @@ class Chunk {
|
|
|
15676
15751
|
finalizeChunk(code, map, hashesByPlaceholder) {
|
|
15677
15752
|
const renderedChunkInfo = this.getRenderedChunkInfo();
|
|
15678
15753
|
const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder);
|
|
15679
|
-
const
|
|
15754
|
+
const preliminaryFileName = renderedChunkInfo.fileName;
|
|
15755
|
+
const fileName = (this.fileName = finalize(preliminaryFileName));
|
|
15680
15756
|
return {
|
|
15681
15757
|
...renderedChunkInfo,
|
|
15682
15758
|
code,
|
|
@@ -15689,6 +15765,7 @@ class Chunk {
|
|
|
15689
15765
|
])),
|
|
15690
15766
|
imports: renderedChunkInfo.imports.map(finalize),
|
|
15691
15767
|
map,
|
|
15768
|
+
preliminaryFileName,
|
|
15692
15769
|
referencedFiles: renderedChunkInfo.referencedFiles.map(finalize)
|
|
15693
15770
|
};
|
|
15694
15771
|
}
|
|
@@ -17438,7 +17515,7 @@ class Link {
|
|
|
17438
17515
|
}
|
|
17439
17516
|
function getLinkMap(log) {
|
|
17440
17517
|
return function linkMap(source, map) {
|
|
17441
|
-
if (map.
|
|
17518
|
+
if (!map.missing) {
|
|
17442
17519
|
return new Link(map, [source]);
|
|
17443
17520
|
}
|
|
17444
17521
|
log(LOGLEVEL_WARN, logSourcemapBroken(map.plugin));
|
|
@@ -17477,6 +17554,9 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon
|
|
|
17477
17554
|
file = basename(file);
|
|
17478
17555
|
}
|
|
17479
17556
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
17557
|
+
for (const module of modules) {
|
|
17558
|
+
resetSourcemapCache(module.originalSourcemap, module.sourcemapChain);
|
|
17559
|
+
}
|
|
17480
17560
|
return new SourceMap({ file, mappings, names, sources, sourcesContent });
|
|
17481
17561
|
}
|
|
17482
17562
|
function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) {
|
|
@@ -17485,29 +17565,11 @@ function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain,
|
|
|
17485
17565
|
}
|
|
17486
17566
|
const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log));
|
|
17487
17567
|
const map = source.traceMappings();
|
|
17488
|
-
return { version: 3, ...map };
|
|
17568
|
+
return decodedSourcemap({ version: 3, ...map });
|
|
17489
17569
|
}
|
|
17490
17570
|
|
|
17491
17571
|
const createHash = () => createHash$1('sha256');
|
|
17492
17572
|
|
|
17493
|
-
function decodedSourcemap(map) {
|
|
17494
|
-
if (!map)
|
|
17495
|
-
return null;
|
|
17496
|
-
if (typeof map === 'string') {
|
|
17497
|
-
map = JSON.parse(map);
|
|
17498
|
-
}
|
|
17499
|
-
if (map.mappings === '') {
|
|
17500
|
-
return {
|
|
17501
|
-
mappings: [],
|
|
17502
|
-
names: [],
|
|
17503
|
-
sources: [],
|
|
17504
|
-
version: 3
|
|
17505
|
-
};
|
|
17506
|
-
}
|
|
17507
|
-
const mappings = typeof map.mappings === 'string' ? decode(map.mappings) : map.mappings;
|
|
17508
|
-
return { ...map, mappings };
|
|
17509
|
-
}
|
|
17510
|
-
|
|
17511
17573
|
async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
|
|
17512
17574
|
timeStart('render chunks', 2);
|
|
17513
17575
|
reserveEntryChunksInBundle(chunks);
|
|
@@ -24967,6 +25029,7 @@ class FileEmitter {
|
|
|
24967
25029
|
moduleIds: [],
|
|
24968
25030
|
modules: {},
|
|
24969
25031
|
name: prebuiltChunk.fileName,
|
|
25032
|
+
preliminaryFileName: prebuiltChunk.fileName,
|
|
24970
25033
|
referencedFiles: [],
|
|
24971
25034
|
type: 'chunk'
|
|
24972
25035
|
};
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type SourceMapSegment =
|
|
|
52
52
|
|
|
53
53
|
export interface ExistingDecodedSourceMap {
|
|
54
54
|
file?: string;
|
|
55
|
-
mappings: SourceMapSegment[][];
|
|
55
|
+
readonly mappings: SourceMapSegment[][];
|
|
56
56
|
names: string[];
|
|
57
57
|
sourceRoot?: string;
|
|
58
58
|
sources: string[];
|
|
@@ -74,11 +74,10 @@ export interface ExistingRawSourceMap {
|
|
|
74
74
|
|
|
75
75
|
export type DecodedSourceMapOrMissing =
|
|
76
76
|
| {
|
|
77
|
-
mappings?: never;
|
|
78
77
|
missing: true;
|
|
79
78
|
plugin: string;
|
|
80
79
|
}
|
|
81
|
-
| ExistingDecodedSourceMap;
|
|
80
|
+
| (ExistingDecodedSourceMap & { missing?: false });
|
|
82
81
|
|
|
83
82
|
export interface SourceMap {
|
|
84
83
|
file: string;
|
|
@@ -828,7 +827,7 @@ export interface OutputAsset extends PreRenderedAsset {
|
|
|
828
827
|
}
|
|
829
828
|
|
|
830
829
|
export interface RenderedModule {
|
|
831
|
-
code: string | null;
|
|
830
|
+
readonly code: string | null;
|
|
832
831
|
originalLength: number;
|
|
833
832
|
removedExports: string[];
|
|
834
833
|
renderedExports: string[];
|
|
@@ -863,6 +862,7 @@ export interface RenderedChunk extends PreRenderedChunk {
|
|
|
863
862
|
export interface OutputChunk extends RenderedChunk {
|
|
864
863
|
code: string;
|
|
865
864
|
map: SourceMap | null;
|
|
865
|
+
preliminaryFileName: string;
|
|
866
866
|
}
|
|
867
867
|
|
|
868
868
|
export interface SerializablePluginCache {
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.28.0
|
|
4
|
+
Wed, 09 Aug 2023 05:34:03 GMT - commit e3b614c9d4555248caa43d062f4003859b388434
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
|
|
|
30
30
|
|
|
31
31
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
32
32
|
|
|
33
|
-
var version$1 = "3.
|
|
33
|
+
var version$1 = "3.28.0";
|
|
34
34
|
|
|
35
35
|
function ensureArray$1(items) {
|
|
36
36
|
if (Array.isArray(items)) {
|
|
@@ -1278,6 +1278,7 @@ class FileEmitter {
|
|
|
1278
1278
|
moduleIds: [],
|
|
1279
1279
|
modules: {},
|
|
1280
1280
|
name: prebuiltChunk.fileName,
|
|
1281
|
+
preliminaryFileName: prebuiltChunk.fileName,
|
|
1281
1282
|
referencedFiles: [],
|
|
1282
1283
|
type: 'chunk'
|
|
1283
1284
|
};
|
|
@@ -14706,12 +14707,82 @@ class SyntheticNamedExportVariable extends Variable {
|
|
|
14706
14707
|
}
|
|
14707
14708
|
}
|
|
14708
14709
|
|
|
14710
|
+
const sourceMapCache = new WeakMap();
|
|
14711
|
+
/**
|
|
14712
|
+
* This clears the decoded array and falls back to the encoded string form.
|
|
14713
|
+
* Sourcemap mappings arrays can be very large and holding on to them for longer
|
|
14714
|
+
* than is necessary leads to poor heap utilization.
|
|
14715
|
+
*/
|
|
14716
|
+
function resetCacheToEncoded(cache) {
|
|
14717
|
+
if (cache.encodedMappings === undefined && cache.decodedMappings) {
|
|
14718
|
+
cache.encodedMappings = encode(cache.decodedMappings);
|
|
14719
|
+
}
|
|
14720
|
+
cache.decodedMappings = undefined;
|
|
14721
|
+
}
|
|
14722
|
+
function resetSourcemapCache(map, sourcemapChain) {
|
|
14723
|
+
if (map) {
|
|
14724
|
+
const cache = sourceMapCache.get(map);
|
|
14725
|
+
if (cache) {
|
|
14726
|
+
resetCacheToEncoded(cache);
|
|
14727
|
+
}
|
|
14728
|
+
}
|
|
14729
|
+
if (!sourcemapChain) {
|
|
14730
|
+
return;
|
|
14731
|
+
}
|
|
14732
|
+
for (const map of sourcemapChain) {
|
|
14733
|
+
if (map.missing)
|
|
14734
|
+
continue;
|
|
14735
|
+
resetSourcemapCache(map);
|
|
14736
|
+
}
|
|
14737
|
+
}
|
|
14738
|
+
function decodedSourcemap(map) {
|
|
14739
|
+
if (!map)
|
|
14740
|
+
return null;
|
|
14741
|
+
if (typeof map === 'string') {
|
|
14742
|
+
map = JSON.parse(map);
|
|
14743
|
+
}
|
|
14744
|
+
if (!map.mappings) {
|
|
14745
|
+
return {
|
|
14746
|
+
mappings: [],
|
|
14747
|
+
names: [],
|
|
14748
|
+
sources: [],
|
|
14749
|
+
version: 3
|
|
14750
|
+
};
|
|
14751
|
+
}
|
|
14752
|
+
const originalMappings = map.mappings;
|
|
14753
|
+
const isAlreadyDecoded = Array.isArray(originalMappings);
|
|
14754
|
+
const cache = {
|
|
14755
|
+
decodedMappings: isAlreadyDecoded ? originalMappings : undefined,
|
|
14756
|
+
encodedMappings: isAlreadyDecoded ? undefined : originalMappings
|
|
14757
|
+
};
|
|
14758
|
+
const decodedMap = {
|
|
14759
|
+
...map,
|
|
14760
|
+
// By moving mappings behind an accessor, we can avoid unneeded computation for cases
|
|
14761
|
+
// where the mappings field is never actually accessed. This appears to greatly reduce
|
|
14762
|
+
// the overhead of sourcemap decoding in terms of both compute time and memory usage.
|
|
14763
|
+
get mappings() {
|
|
14764
|
+
if (cache.decodedMappings) {
|
|
14765
|
+
return cache.decodedMappings;
|
|
14766
|
+
}
|
|
14767
|
+
// If decodedMappings doesn't exist then encodedMappings should.
|
|
14768
|
+
// The only scenario where cache.encodedMappings should be undefined is if the map
|
|
14769
|
+
// this was constructed from was already decoded, or if mappings was set to a new
|
|
14770
|
+
// decoded string. In either case, this line shouldn't get hit.
|
|
14771
|
+
cache.decodedMappings = cache.encodedMappings ? decode(cache.encodedMappings) : [];
|
|
14772
|
+
cache.encodedMappings = undefined;
|
|
14773
|
+
return cache.decodedMappings;
|
|
14774
|
+
}
|
|
14775
|
+
};
|
|
14776
|
+
sourceMapCache.set(decodedMap, cache);
|
|
14777
|
+
return decodedMap;
|
|
14778
|
+
}
|
|
14779
|
+
|
|
14709
14780
|
function getId(m) {
|
|
14710
14781
|
return m.id;
|
|
14711
14782
|
}
|
|
14712
14783
|
|
|
14713
14784
|
function getOriginalLocation(sourcemapChain, location) {
|
|
14714
|
-
const filteredSourcemapChain = sourcemapChain.filter((sourcemap) =>
|
|
14785
|
+
const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !sourcemap.missing);
|
|
14715
14786
|
traceSourcemap: while (filteredSourcemapChain.length > 0) {
|
|
14716
14787
|
const sourcemap = filteredSourcemapChain.pop();
|
|
14717
14788
|
const line = sourcemap.mappings[location.line - 1];
|
|
@@ -15409,8 +15480,13 @@ class Module {
|
|
|
15409
15480
|
timeStart('generate ast', 3);
|
|
15410
15481
|
this.info.code = code;
|
|
15411
15482
|
this.originalCode = originalCode;
|
|
15412
|
-
|
|
15413
|
-
|
|
15483
|
+
// We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't
|
|
15484
|
+
// have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the
|
|
15485
|
+
// RollupCache stores `ExistingDecodedSourcemap` instead of `ExistingRawSourcemap`
|
|
15486
|
+
this.originalSourcemap = decodedSourcemap(originalSourcemap);
|
|
15487
|
+
this.sourcemapChain = sourcemapChain.map(mapOrMissing => mapOrMissing.missing ? mapOrMissing : decodedSourcemap(mapOrMissing));
|
|
15488
|
+
// If coming from cache and this value is already fully decoded, we want to re-encode here to save memory.
|
|
15489
|
+
resetSourcemapCache(this.originalSourcemap, this.sourcemapChain);
|
|
15414
15490
|
if (transformFiles) {
|
|
15415
15491
|
this.transformFiles = transformFiles;
|
|
15416
15492
|
}
|
|
@@ -17060,7 +17136,8 @@ class Chunk {
|
|
|
17060
17136
|
finalizeChunk(code, map, hashesByPlaceholder) {
|
|
17061
17137
|
const renderedChunkInfo = this.getRenderedChunkInfo();
|
|
17062
17138
|
const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder);
|
|
17063
|
-
const
|
|
17139
|
+
const preliminaryFileName = renderedChunkInfo.fileName;
|
|
17140
|
+
const fileName = (this.fileName = finalize(preliminaryFileName));
|
|
17064
17141
|
return {
|
|
17065
17142
|
...renderedChunkInfo,
|
|
17066
17143
|
code,
|
|
@@ -17073,6 +17150,7 @@ class Chunk {
|
|
|
17073
17150
|
])),
|
|
17074
17151
|
imports: renderedChunkInfo.imports.map(finalize),
|
|
17075
17152
|
map,
|
|
17153
|
+
preliminaryFileName,
|
|
17076
17154
|
referencedFiles: renderedChunkInfo.referencedFiles.map(finalize)
|
|
17077
17155
|
};
|
|
17078
17156
|
}
|
|
@@ -18822,7 +18900,7 @@ class Link {
|
|
|
18822
18900
|
}
|
|
18823
18901
|
function getLinkMap(log) {
|
|
18824
18902
|
return function linkMap(source, map) {
|
|
18825
|
-
if (map.
|
|
18903
|
+
if (!map.missing) {
|
|
18826
18904
|
return new Link(map, [source]);
|
|
18827
18905
|
}
|
|
18828
18906
|
log(LOGLEVEL_WARN, logSourcemapBroken(map.plugin));
|
|
@@ -18861,6 +18939,9 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon
|
|
|
18861
18939
|
file = node_path.basename(file);
|
|
18862
18940
|
}
|
|
18863
18941
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
18942
|
+
for (const module of modules) {
|
|
18943
|
+
resetSourcemapCache(module.originalSourcemap, module.sourcemapChain);
|
|
18944
|
+
}
|
|
18864
18945
|
return new SourceMap({ file, mappings, names, sources, sourcesContent });
|
|
18865
18946
|
}
|
|
18866
18947
|
function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) {
|
|
@@ -18869,25 +18950,7 @@ function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain,
|
|
|
18869
18950
|
}
|
|
18870
18951
|
const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log));
|
|
18871
18952
|
const map = source.traceMappings();
|
|
18872
|
-
return { version: 3, ...map };
|
|
18873
|
-
}
|
|
18874
|
-
|
|
18875
|
-
function decodedSourcemap(map) {
|
|
18876
|
-
if (!map)
|
|
18877
|
-
return null;
|
|
18878
|
-
if (typeof map === 'string') {
|
|
18879
|
-
map = JSON.parse(map);
|
|
18880
|
-
}
|
|
18881
|
-
if (map.mappings === '') {
|
|
18882
|
-
return {
|
|
18883
|
-
mappings: [],
|
|
18884
|
-
names: [],
|
|
18885
|
-
sources: [],
|
|
18886
|
-
version: 3
|
|
18887
|
-
};
|
|
18888
|
-
}
|
|
18889
|
-
const mappings = typeof map.mappings === 'string' ? decode(map.mappings) : map.mappings;
|
|
18890
|
-
return { ...map, mappings };
|
|
18953
|
+
return decodedSourcemap({ version: 3, ...map });
|
|
18891
18954
|
}
|
|
18892
18955
|
|
|
18893
18956
|
async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED