@rollup/wasm-node 4.20.0 → 4.21.1
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 +3 -6
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +74 -63
- package/dist/es/shared/parseAst.js +2 -3
- package/dist/es/shared/watch.js +4 -4
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +19 -31
- 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 +3 -3
- package/dist/shared/parseAst.js +2 -3
- package/dist/shared/rollup.js +157 -146
- package/dist/shared/watch-cli.js +9 -8
- package/dist/shared/watch.js +4 -4
- package/dist/wasm-node/bindings_wasm.js +38 -37
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +19 -20
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
33
33
|
|
|
34
|
-
var version = "4.
|
|
34
|
+
var version = "4.21.1";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -165,12 +165,16 @@ const removeUnreferencedAssets = (outputBundle) => {
|
|
|
165
165
|
const unreferencedAssets = new Set();
|
|
166
166
|
const bundleEntries = Object.values(outputBundle);
|
|
167
167
|
for (const asset of bundleEntries) {
|
|
168
|
-
asset.type === 'asset' && asset.needsCodeReference
|
|
168
|
+
if (asset.type === 'asset' && asset.needsCodeReference) {
|
|
169
|
+
unreferencedAssets.add(asset.fileName);
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
for (const chunk of bundleEntries) {
|
|
171
173
|
if (chunk.type === 'chunk') {
|
|
172
174
|
for (const referencedFile of chunk.referencedFiles) {
|
|
173
|
-
unreferencedAssets.has(referencedFile)
|
|
175
|
+
if (unreferencedAssets.has(referencedFile)) {
|
|
176
|
+
unreferencedAssets.delete(referencedFile);
|
|
177
|
+
}
|
|
174
178
|
}
|
|
175
179
|
}
|
|
176
180
|
}
|
|
@@ -537,89 +541,6 @@ class FileEmitter {
|
|
|
537
541
|
}
|
|
538
542
|
}
|
|
539
543
|
|
|
540
|
-
const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
|
|
541
|
-
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
|
|
542
|
-
|
|
543
|
-
function createPluginCache(cache) {
|
|
544
|
-
return {
|
|
545
|
-
delete(id) {
|
|
546
|
-
return delete cache[id];
|
|
547
|
-
},
|
|
548
|
-
get(id) {
|
|
549
|
-
const item = cache[id];
|
|
550
|
-
if (!item)
|
|
551
|
-
return;
|
|
552
|
-
item[0] = 0;
|
|
553
|
-
return item[1];
|
|
554
|
-
},
|
|
555
|
-
has(id) {
|
|
556
|
-
const item = cache[id];
|
|
557
|
-
if (!item)
|
|
558
|
-
return false;
|
|
559
|
-
item[0] = 0;
|
|
560
|
-
return true;
|
|
561
|
-
},
|
|
562
|
-
set(id, value) {
|
|
563
|
-
cache[id] = [0, value];
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
function getTrackedPluginCache(pluginCache, onUse) {
|
|
568
|
-
return {
|
|
569
|
-
delete(id) {
|
|
570
|
-
onUse();
|
|
571
|
-
return pluginCache.delete(id);
|
|
572
|
-
},
|
|
573
|
-
get(id) {
|
|
574
|
-
onUse();
|
|
575
|
-
return pluginCache.get(id);
|
|
576
|
-
},
|
|
577
|
-
has(id) {
|
|
578
|
-
onUse();
|
|
579
|
-
return pluginCache.has(id);
|
|
580
|
-
},
|
|
581
|
-
set(id, value) {
|
|
582
|
-
onUse();
|
|
583
|
-
return pluginCache.set(id, value);
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
const NO_CACHE = {
|
|
588
|
-
delete() {
|
|
589
|
-
return false;
|
|
590
|
-
},
|
|
591
|
-
get() {
|
|
592
|
-
return undefined;
|
|
593
|
-
},
|
|
594
|
-
has() {
|
|
595
|
-
return false;
|
|
596
|
-
},
|
|
597
|
-
set() { }
|
|
598
|
-
};
|
|
599
|
-
function uncacheablePluginError(pluginName) {
|
|
600
|
-
if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
|
|
601
|
-
pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
|
|
602
|
-
return parseAst_js.error(parseAst_js.logAnonymousPluginCache());
|
|
603
|
-
}
|
|
604
|
-
return parseAst_js.error(parseAst_js.logDuplicatePluginName(pluginName));
|
|
605
|
-
}
|
|
606
|
-
function getCacheForUncacheablePlugin(pluginName) {
|
|
607
|
-
return {
|
|
608
|
-
delete() {
|
|
609
|
-
return uncacheablePluginError(pluginName);
|
|
610
|
-
},
|
|
611
|
-
get() {
|
|
612
|
-
return uncacheablePluginError(pluginName);
|
|
613
|
-
},
|
|
614
|
-
has() {
|
|
615
|
-
return uncacheablePluginError(pluginName);
|
|
616
|
-
},
|
|
617
|
-
set() {
|
|
618
|
-
return uncacheablePluginError(pluginName);
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
|
|
623
544
|
const doNothing = () => { };
|
|
624
545
|
|
|
625
546
|
async function asyncFlatten(array) {
|
|
@@ -776,6 +697,89 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
|
|
|
776
697
|
};
|
|
777
698
|
}
|
|
778
699
|
|
|
700
|
+
const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
|
|
701
|
+
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
|
|
702
|
+
|
|
703
|
+
function createPluginCache(cache) {
|
|
704
|
+
return {
|
|
705
|
+
delete(id) {
|
|
706
|
+
return delete cache[id];
|
|
707
|
+
},
|
|
708
|
+
get(id) {
|
|
709
|
+
const item = cache[id];
|
|
710
|
+
if (!item)
|
|
711
|
+
return;
|
|
712
|
+
item[0] = 0;
|
|
713
|
+
return item[1];
|
|
714
|
+
},
|
|
715
|
+
has(id) {
|
|
716
|
+
const item = cache[id];
|
|
717
|
+
if (!item)
|
|
718
|
+
return false;
|
|
719
|
+
item[0] = 0;
|
|
720
|
+
return true;
|
|
721
|
+
},
|
|
722
|
+
set(id, value) {
|
|
723
|
+
cache[id] = [0, value];
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
function getTrackedPluginCache(pluginCache, onUse) {
|
|
728
|
+
return {
|
|
729
|
+
delete(id) {
|
|
730
|
+
onUse();
|
|
731
|
+
return pluginCache.delete(id);
|
|
732
|
+
},
|
|
733
|
+
get(id) {
|
|
734
|
+
onUse();
|
|
735
|
+
return pluginCache.get(id);
|
|
736
|
+
},
|
|
737
|
+
has(id) {
|
|
738
|
+
onUse();
|
|
739
|
+
return pluginCache.has(id);
|
|
740
|
+
},
|
|
741
|
+
set(id, value) {
|
|
742
|
+
onUse();
|
|
743
|
+
return pluginCache.set(id, value);
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
const NO_CACHE = {
|
|
748
|
+
delete() {
|
|
749
|
+
return false;
|
|
750
|
+
},
|
|
751
|
+
get() {
|
|
752
|
+
return undefined;
|
|
753
|
+
},
|
|
754
|
+
has() {
|
|
755
|
+
return false;
|
|
756
|
+
},
|
|
757
|
+
set() { }
|
|
758
|
+
};
|
|
759
|
+
function uncacheablePluginError(pluginName) {
|
|
760
|
+
if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
|
|
761
|
+
pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
|
|
762
|
+
return parseAst_js.error(parseAst_js.logAnonymousPluginCache());
|
|
763
|
+
}
|
|
764
|
+
return parseAst_js.error(parseAst_js.logDuplicatePluginName(pluginName));
|
|
765
|
+
}
|
|
766
|
+
function getCacheForUncacheablePlugin(pluginName) {
|
|
767
|
+
return {
|
|
768
|
+
delete() {
|
|
769
|
+
return uncacheablePluginError(pluginName);
|
|
770
|
+
},
|
|
771
|
+
get() {
|
|
772
|
+
return uncacheablePluginError(pluginName);
|
|
773
|
+
},
|
|
774
|
+
has() {
|
|
775
|
+
return uncacheablePluginError(pluginName);
|
|
776
|
+
},
|
|
777
|
+
set() {
|
|
778
|
+
return uncacheablePluginError(pluginName);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
|
|
779
783
|
function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) {
|
|
780
784
|
const { logLevel, onLog } = options;
|
|
781
785
|
let cacheable = true;
|
|
@@ -992,7 +996,7 @@ class PluginDriver {
|
|
|
992
996
|
if (typeof handler !== 'function') {
|
|
993
997
|
return handler;
|
|
994
998
|
}
|
|
995
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
999
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
996
1000
|
const hookResult = handler.apply(context, parameters);
|
|
997
1001
|
if (!hookResult?.then) {
|
|
998
1002
|
// short circuit for non-thenables and non-Promises
|
|
@@ -1037,7 +1041,7 @@ class PluginDriver {
|
|
|
1037
1041
|
context = replaceContext(context, plugin);
|
|
1038
1042
|
}
|
|
1039
1043
|
try {
|
|
1040
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
1044
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1041
1045
|
return handler.apply(context, parameters);
|
|
1042
1046
|
}
|
|
1043
1047
|
catch (error_) {
|
|
@@ -1294,7 +1298,8 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
1294
1298
|
sourcemapPathTransform: getOption('sourcemapPathTransform'),
|
|
1295
1299
|
strict: getOption('strict'),
|
|
1296
1300
|
systemNullSetters: getOption('systemNullSetters'),
|
|
1297
|
-
validate: getOption('validate')
|
|
1301
|
+
validate: getOption('validate'),
|
|
1302
|
+
virtualDirname: getOption('virtualDirname')
|
|
1298
1303
|
};
|
|
1299
1304
|
warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log);
|
|
1300
1305
|
return outputOptions;
|
|
@@ -8863,7 +8868,9 @@ class ChildScope extends Scope {
|
|
|
8863
8868
|
this.parent.addNamespaceMemberAccess(name, variable);
|
|
8864
8869
|
}
|
|
8865
8870
|
addReturnExpression(expression) {
|
|
8866
|
-
this.parent instanceof ChildScope
|
|
8871
|
+
if (this.parent instanceof ChildScope) {
|
|
8872
|
+
this.parent.addReturnExpression(expression);
|
|
8873
|
+
}
|
|
8867
8874
|
}
|
|
8868
8875
|
addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
|
|
8869
8876
|
for (const variable of this.accessedOutsideVariables.values()) {
|
|
@@ -9179,12 +9186,15 @@ function renderStatementList(statements, code, start, end, options) {
|
|
|
9179
9186
|
currentNode.end +
|
|
9180
9187
|
findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
|
|
9181
9188
|
if (currentNode.included) {
|
|
9182
|
-
currentNodeNeedsBoundaries
|
|
9183
|
-
|
|
9189
|
+
if (currentNodeNeedsBoundaries) {
|
|
9190
|
+
currentNode.render(code, options, {
|
|
9184
9191
|
end: nextNodeStart,
|
|
9185
9192
|
start: currentNodeStart
|
|
9186
|
-
})
|
|
9187
|
-
|
|
9193
|
+
});
|
|
9194
|
+
}
|
|
9195
|
+
else {
|
|
9196
|
+
currentNode.render(code, options);
|
|
9197
|
+
}
|
|
9188
9198
|
}
|
|
9189
9199
|
else {
|
|
9190
9200
|
treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
|
|
@@ -9378,7 +9388,9 @@ class RestElement extends NodeBase {
|
|
|
9378
9388
|
return this.argument.declare(kind, UNKNOWN_EXPRESSION);
|
|
9379
9389
|
}
|
|
9380
9390
|
deoptimizePath(path) {
|
|
9381
|
-
path.length === 0
|
|
9391
|
+
if (path.length === 0) {
|
|
9392
|
+
this.argument.deoptimizePath(EMPTY_PATH);
|
|
9393
|
+
}
|
|
9382
9394
|
}
|
|
9383
9395
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
9384
9396
|
return (path.length > 0 ||
|
|
@@ -9833,7 +9845,9 @@ class AssignmentPattern extends NodeBase {
|
|
|
9833
9845
|
return this.left.declare(kind, init);
|
|
9834
9846
|
}
|
|
9835
9847
|
deoptimizePath(path) {
|
|
9836
|
-
path.length === 0
|
|
9848
|
+
if (path.length === 0) {
|
|
9849
|
+
this.left.deoptimizePath(path);
|
|
9850
|
+
}
|
|
9837
9851
|
}
|
|
9838
9852
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
9839
9853
|
return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context));
|
|
@@ -11945,7 +11959,7 @@ const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, l
|
|
|
11945
11959
|
};
|
|
11946
11960
|
const HELPER_GENERATORS = {
|
|
11947
11961
|
[DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) {
|
|
11948
|
-
return `var${
|
|
11962
|
+
return `var ${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`;
|
|
11949
11963
|
},
|
|
11950
11964
|
[INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) {
|
|
11951
11965
|
const { _, getDirectReturnFunction, n } = snippets;
|
|
@@ -13223,7 +13237,9 @@ class SwitchCase extends NodeBase {
|
|
|
13223
13237
|
}
|
|
13224
13238
|
render(code, options, nodeRenderOptions) {
|
|
13225
13239
|
if (this.consequent.length > 0) {
|
|
13226
|
-
|
|
13240
|
+
if (this.test) {
|
|
13241
|
+
this.test.render(code, options);
|
|
13242
|
+
}
|
|
13227
13243
|
const testEnd = this.test
|
|
13228
13244
|
? this.test.end
|
|
13229
13245
|
: findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
|
|
@@ -15339,21 +15355,17 @@ class Module {
|
|
|
15339
15355
|
},
|
|
15340
15356
|
id,
|
|
15341
15357
|
get implicitlyLoadedAfterOneOf() {
|
|
15342
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
15343
15358
|
return Array.from(implicitlyLoadedAfter, getId).sort();
|
|
15344
15359
|
},
|
|
15345
15360
|
get implicitlyLoadedBefore() {
|
|
15346
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
15347
15361
|
return Array.from(implicitlyLoadedBefore, getId).sort();
|
|
15348
15362
|
},
|
|
15349
15363
|
get importedIdResolutions() {
|
|
15350
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
15351
15364
|
return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]).filter(Boolean);
|
|
15352
15365
|
},
|
|
15353
15366
|
get importedIds() {
|
|
15354
15367
|
// We cannot use this.dependencies because this is needed before
|
|
15355
15368
|
// dependencies are populated
|
|
15356
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
15357
15369
|
return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id).filter(Boolean);
|
|
15358
15370
|
},
|
|
15359
15371
|
get importers() {
|
|
@@ -15396,7 +15408,9 @@ class Module {
|
|
|
15396
15408
|
]);
|
|
15397
15409
|
}
|
|
15398
15410
|
error(properties, pos) {
|
|
15399
|
-
pos !== undefined
|
|
15411
|
+
if (pos !== undefined) {
|
|
15412
|
+
this.addLocationToLogProps(properties, pos);
|
|
15413
|
+
}
|
|
15400
15414
|
return parseAst_js.error(properties);
|
|
15401
15415
|
}
|
|
15402
15416
|
// sum up the length of all ast nodes that are included
|
|
@@ -15818,7 +15832,6 @@ class Module {
|
|
|
15818
15832
|
attributes: this.info.attributes,
|
|
15819
15833
|
code: this.info.code,
|
|
15820
15834
|
customTransformCache: this.customTransformCache,
|
|
15821
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
15822
15835
|
dependencies: Array.from(this.dependencies, getId),
|
|
15823
15836
|
id: this.id,
|
|
15824
15837
|
meta: this.info.meta,
|
|
@@ -16185,7 +16198,6 @@ function setAlternativeExporterIfCyclic(variable, importer, reexporter) {
|
|
|
16185
16198
|
}
|
|
16186
16199
|
}
|
|
16187
16200
|
const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules &&
|
|
16188
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
16189
16201
|
new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)]));
|
|
16190
16202
|
|
|
16191
16203
|
function removeJsExtension(name) {
|
|
@@ -17501,7 +17513,6 @@ class Chunk {
|
|
|
17501
17513
|
}
|
|
17502
17514
|
}
|
|
17503
17515
|
for (const module of entryModules) {
|
|
17504
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
17505
17516
|
const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)),
|
|
17506
17517
|
// mapping must run after Set 'name' dedupe
|
|
17507
17518
|
name => ({
|
|
@@ -17510,7 +17521,6 @@ class Chunk {
|
|
|
17510
17521
|
if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {
|
|
17511
17522
|
requiredFacades.push({});
|
|
17512
17523
|
}
|
|
17513
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
17514
17524
|
requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));
|
|
17515
17525
|
if (requiredFacades.length === 0) {
|
|
17516
17526
|
requiredFacades.push({});
|
|
@@ -17635,10 +17645,8 @@ class Chunk {
|
|
|
17635
17645
|
...this.getPreRenderedChunkInfo(),
|
|
17636
17646
|
dynamicImports: this.getDynamicDependencies().map(resolveFileName),
|
|
17637
17647
|
fileName: this.getFileName(),
|
|
17638
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
17639
17648
|
implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName),
|
|
17640
17649
|
importedBindings: getImportedBindingsPerDependency(this.getRenderedDependencies(), resolveFileName),
|
|
17641
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
17642
17650
|
imports: Array.from(this.dependencies, resolveFileName),
|
|
17643
17651
|
modules: this.renderedModules,
|
|
17644
17652
|
referencedFiles: this.getReferencedFiles()
|
|
@@ -17683,9 +17691,7 @@ class Chunk {
|
|
|
17683
17691
|
hasDefaultExport = true;
|
|
17684
17692
|
}
|
|
17685
17693
|
if (format === 'es') {
|
|
17686
|
-
renderedDependency.reexports = reexports.filter(
|
|
17687
|
-
// eslint-disable-next-line unicorn/prefer-array-some
|
|
17688
|
-
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
17694
|
+
renderedDependency.reexports = reexports.filter(({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
17689
17695
|
}
|
|
17690
17696
|
}
|
|
17691
17697
|
}
|
|
@@ -17719,7 +17725,9 @@ class Chunk {
|
|
|
17719
17725
|
magicString.prepend(banner);
|
|
17720
17726
|
if (format === 'es' || format === 'cjs') {
|
|
17721
17727
|
const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
|
|
17722
|
-
|
|
17728
|
+
if (shebang) {
|
|
17729
|
+
magicString.prepend(`#!${shebang}\n`);
|
|
17730
|
+
}
|
|
17723
17731
|
}
|
|
17724
17732
|
if (footer)
|
|
17725
17733
|
magicString.append(footer);
|
|
@@ -18035,12 +18043,19 @@ class Chunk {
|
|
|
18035
18043
|
? sanitizedId.slice(0, -extensionName.length)
|
|
18036
18044
|
: sanitizedId;
|
|
18037
18045
|
if (parseAst_js.isAbsolute(idWithoutExtension)) {
|
|
18038
|
-
|
|
18039
|
-
|
|
18040
|
-
|
|
18046
|
+
if (preserveModulesRoot && path$2.resolve(idWithoutExtension).startsWith(preserveModulesRoot)) {
|
|
18047
|
+
return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, '');
|
|
18048
|
+
}
|
|
18049
|
+
else {
|
|
18050
|
+
// handle edge case in Windows
|
|
18051
|
+
if (this.inputBase === '/' && !idWithoutExtension.startsWith('/')) {
|
|
18052
|
+
return parseAst_js.relative(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/'));
|
|
18053
|
+
}
|
|
18054
|
+
return parseAst_js.relative(this.inputBase, idWithoutExtension);
|
|
18055
|
+
}
|
|
18041
18056
|
}
|
|
18042
18057
|
else {
|
|
18043
|
-
return
|
|
18058
|
+
return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + path$2.basename(idWithoutExtension));
|
|
18044
18059
|
}
|
|
18045
18060
|
}
|
|
18046
18061
|
getReexportSpecifiers() {
|
|
@@ -18177,7 +18192,6 @@ class Chunk {
|
|
|
18177
18192
|
const rendered = module.render(renderOptions);
|
|
18178
18193
|
if (!renderOptions.accessedDocumentCurrentScript &&
|
|
18179
18194
|
formatsMaybeAccessDocumentCurrentScript.includes(format)) {
|
|
18180
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
18181
18195
|
this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
18182
18196
|
}
|
|
18183
18197
|
renderOptions.accessedDocumentCurrentScript = false;
|
|
@@ -18219,7 +18233,6 @@ class Chunk {
|
|
|
18219
18233
|
}
|
|
18220
18234
|
if (hoistedSource)
|
|
18221
18235
|
magicString.prepend(hoistedSource + n + n);
|
|
18222
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
18223
18236
|
if (this.needsExportsShim) {
|
|
18224
18237
|
magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);
|
|
18225
18238
|
}
|
|
@@ -18879,11 +18892,13 @@ function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, l
|
|
|
18879
18892
|
timeEnd('optimize chunks', 3);
|
|
18880
18893
|
return chunks; // the actual modules
|
|
18881
18894
|
}
|
|
18882
|
-
minChunkSize > 1
|
|
18895
|
+
if (minChunkSize > 1) {
|
|
18883
18896
|
log('info', parseAst_js.logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially'));
|
|
18897
|
+
}
|
|
18884
18898
|
mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom);
|
|
18885
|
-
minChunkSize > 1
|
|
18899
|
+
if (minChunkSize > 1) {
|
|
18886
18900
|
log('info', parseAst_js.logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks'));
|
|
18901
|
+
}
|
|
18887
18902
|
timeEnd('optimize chunks', 3);
|
|
18888
18903
|
return [...chunkPartition.small, ...chunkPartition.big];
|
|
18889
18904
|
}
|
|
@@ -19602,7 +19617,6 @@ class Bundle {
|
|
|
19602
19617
|
return manualChunkAliasByEntry;
|
|
19603
19618
|
}
|
|
19604
19619
|
assignManualChunks(getManualChunk) {
|
|
19605
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
19606
19620
|
const manualChunkAliasesWithEntry = [];
|
|
19607
19621
|
const manualChunksApi = {
|
|
19608
19622
|
getModuleIds: () => this.graph.modulesById.keys(),
|
|
@@ -19758,6 +19772,22 @@ function flru (max) {
|
|
|
19758
19772
|
};
|
|
19759
19773
|
}
|
|
19760
19774
|
|
|
19775
|
+
class GlobalScope extends Scope {
|
|
19776
|
+
constructor() {
|
|
19777
|
+
super();
|
|
19778
|
+
this.parent = null;
|
|
19779
|
+
this.variables.set('undefined', new UndefinedVariable());
|
|
19780
|
+
}
|
|
19781
|
+
findVariable(name) {
|
|
19782
|
+
let variable = this.variables.get(name);
|
|
19783
|
+
if (!variable) {
|
|
19784
|
+
variable = new GlobalVariable(name);
|
|
19785
|
+
this.variables.set(name, variable);
|
|
19786
|
+
}
|
|
19787
|
+
return variable;
|
|
19788
|
+
}
|
|
19789
|
+
}
|
|
19790
|
+
|
|
19761
19791
|
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) {
|
|
19762
19792
|
let skipped = null;
|
|
19763
19793
|
let replaceContext = null;
|
|
@@ -20263,7 +20293,6 @@ class ModuleLoader {
|
|
|
20263
20293
|
});
|
|
20264
20294
|
}
|
|
20265
20295
|
getResolveStaticDependencyPromises(module) {
|
|
20266
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
20267
20296
|
return Array.from(module.sourcesWithAttributes, async ([source, attributes]) => [
|
|
20268
20297
|
source,
|
|
20269
20298
|
(module.resolvedIds[source] =
|
|
@@ -20402,22 +20431,6 @@ async function waitForDependencyResolution(loadPromise) {
|
|
|
20402
20431
|
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
|
|
20403
20432
|
}
|
|
20404
20433
|
|
|
20405
|
-
class GlobalScope extends Scope {
|
|
20406
|
-
constructor() {
|
|
20407
|
-
super();
|
|
20408
|
-
this.parent = null;
|
|
20409
|
-
this.variables.set('undefined', new UndefinedVariable());
|
|
20410
|
-
}
|
|
20411
|
-
findVariable(name) {
|
|
20412
|
-
let variable = this.variables.get(name);
|
|
20413
|
-
if (!variable) {
|
|
20414
|
-
variable = new GlobalVariable(name);
|
|
20415
|
-
this.variables.set(name, variable);
|
|
20416
|
-
}
|
|
20417
|
-
return variable;
|
|
20418
|
-
}
|
|
20419
|
-
}
|
|
20420
|
-
|
|
20421
20434
|
class Queue {
|
|
20422
20435
|
constructor(maxParallel) {
|
|
20423
20436
|
this.maxParallel = maxParallel;
|
|
@@ -20889,7 +20902,8 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
20889
20902
|
sourcemapPathTransform: config.sourcemapPathTransform,
|
|
20890
20903
|
strict: config.strict ?? true,
|
|
20891
20904
|
systemNullSetters: config.systemNullSetters ?? true,
|
|
20892
|
-
validate: config.validate || false
|
|
20905
|
+
validate: config.validate || false,
|
|
20906
|
+
virtualDirname: config.virtualDirname || '_virtual'
|
|
20893
20907
|
};
|
|
20894
20908
|
warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog);
|
|
20895
20909
|
return { options: outputOptions, unsetOptions };
|
|
@@ -20994,7 +21008,6 @@ const getAddon = (config, name) => {
|
|
|
20994
21008
|
}
|
|
20995
21009
|
return () => configAddon || '';
|
|
20996
21010
|
};
|
|
20997
|
-
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
20998
21011
|
const getDir = (config, file) => {
|
|
20999
21012
|
const { dir } = config;
|
|
21000
21013
|
if (typeof dir === 'string' && typeof file === 'string') {
|
|
@@ -21064,9 +21077,7 @@ const getInterop = (config) => {
|
|
|
21064
21077
|
};
|
|
21065
21078
|
const validateInterop = (interop) => {
|
|
21066
21079
|
if (!ALLOWED_INTEROP_TYPES.has(interop)) {
|
|
21067
|
-
return parseAst_js.error(parseAst_js.logInvalidOption('output.interop', parseAst_js.URL_OUTPUT_INTEROP,
|
|
21068
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
21069
|
-
`use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop));
|
|
21080
|
+
return parseAst_js.error(parseAst_js.logInvalidOption('output.interop', parseAst_js.URL_OUTPUT_INTEROP, `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop));
|
|
21070
21081
|
}
|
|
21071
21082
|
return interop;
|
|
21072
21083
|
};
|
package/dist/shared/watch-cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
13
|
|
|
14
|
+
const index = require('./index.js');
|
|
14
15
|
const promises = require('node:fs/promises');
|
|
15
16
|
const process$2 = require('node:process');
|
|
16
|
-
const index = require('./index.js');
|
|
17
17
|
const cli = require('../bin/rollup');
|
|
18
18
|
const rollup = require('./rollup.js');
|
|
19
19
|
const parseAst_js = require('./parseAst.js');
|
|
@@ -539,16 +539,17 @@ async function watch(command) {
|
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
541
|
}
|
|
542
|
-
|
|
542
|
+
function close(code) {
|
|
543
543
|
process$2.removeListener('uncaughtException', closeWithError);
|
|
544
544
|
// removing a non-existent listener is a no-op
|
|
545
545
|
process$2.stdin.removeListener('end', close);
|
|
546
|
-
if (watcher)
|
|
547
|
-
await watcher.close();
|
|
548
546
|
if (configWatcher)
|
|
549
547
|
configWatcher.close();
|
|
550
|
-
|
|
551
|
-
process$2.exit(code);
|
|
548
|
+
Promise.resolve(watcher?.close()).finally(() => {
|
|
549
|
+
process$2.exit(typeof code === 'number' ? code : 0);
|
|
550
|
+
});
|
|
551
|
+
// Tell signal-exit that we are handling this gracefully
|
|
552
|
+
return true;
|
|
552
553
|
}
|
|
553
554
|
// return a promise that never resolves to keep the process running
|
|
554
555
|
return new Promise(() => { });
|
package/dist/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
13
|
|
|
14
|
+
const rollup = require('./rollup.js');
|
|
14
15
|
const path = require('node:path');
|
|
15
16
|
const process = require('node:process');
|
|
16
|
-
const rollup = require('./rollup.js');
|
|
17
|
-
const node_os = require('node:os');
|
|
18
17
|
const index = require('./index.js');
|
|
18
|
+
const node_os = require('node:os');
|
|
19
19
|
require('./parseAst.js');
|
|
20
20
|
require('../native.js');
|
|
21
21
|
require('tty');
|