rollup 4.51.1-0 → 4.52.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 +2 -2
- 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 +33 -46
- package/dist/es/shared/parseAst.js +2 -2
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +3 -0
- 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/parseAst.js +2 -2
- package/dist/shared/rollup.js +33 -46
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +23 -23
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.52.1
|
|
5
|
+
Tue, 23 Sep 2025 04:29:13 GMT - commit 69b5dd3e3edc03ab02cf948ea5278226fc9e60c8
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.52.1
|
|
4
|
+
Tue, 23 Sep 2025 04:29:13 GMT - commit 69b5dd3e3edc03ab02cf948ea5278226fc9e60c8
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
|
|
27
27
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version = "4.
|
|
30
|
+
var version = "4.52.1";
|
|
31
31
|
|
|
32
32
|
// src/vlq.ts
|
|
33
33
|
var comma = ",".charCodeAt(0);
|
|
@@ -12093,10 +12093,10 @@ class CallExpressionBase extends NodeBase {
|
|
|
12093
12093
|
|
|
12094
12094
|
class CallExpression extends CallExpressionBase {
|
|
12095
12095
|
get hasCheckedForWarnings() {
|
|
12096
|
-
return isFlagSet(this.flags,
|
|
12096
|
+
return isFlagSet(this.flags, 134217728 /* Flag.checkedForWarnings */);
|
|
12097
12097
|
}
|
|
12098
12098
|
set hasCheckedForWarnings(value) {
|
|
12099
|
-
this.flags = setFlag(this.flags,
|
|
12099
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.checkedForWarnings */, value);
|
|
12100
12100
|
}
|
|
12101
12101
|
get optional() {
|
|
12102
12102
|
return isFlagSet(this.flags, 128 /* Flag.optional */);
|
|
@@ -13126,16 +13126,10 @@ class ImportExpression extends NodeBase {
|
|
|
13126
13126
|
this.resolutionString = null;
|
|
13127
13127
|
}
|
|
13128
13128
|
get shouldIncludeDynamicAttributes() {
|
|
13129
|
-
return isFlagSet(this.flags,
|
|
13129
|
+
return isFlagSet(this.flags, 268435456 /* Flag.shouldIncludeDynamicAttributes */);
|
|
13130
13130
|
}
|
|
13131
13131
|
set shouldIncludeDynamicAttributes(value) {
|
|
13132
|
-
this.flags = setFlag(this.flags,
|
|
13133
|
-
}
|
|
13134
|
-
get withinTopLevelAwait() {
|
|
13135
|
-
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
13136
|
-
}
|
|
13137
|
-
set withinTopLevelAwait(value) {
|
|
13138
|
-
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
13132
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.shouldIncludeDynamicAttributes */, value);
|
|
13139
13133
|
}
|
|
13140
13134
|
bind() {
|
|
13141
13135
|
this.source.bind();
|
|
@@ -13159,7 +13153,7 @@ class ImportExpression extends NodeBase {
|
|
|
13159
13153
|
}
|
|
13160
13154
|
if (parent1 instanceof AwaitExpression) {
|
|
13161
13155
|
const parent2 = parent1.parent;
|
|
13162
|
-
// Side
|
|
13156
|
+
// Side effect only: await import('bar')
|
|
13163
13157
|
if (parent2 instanceof ExpressionStatement) {
|
|
13164
13158
|
return EMPTY_ARRAY;
|
|
13165
13159
|
}
|
|
@@ -13252,22 +13246,6 @@ class ImportExpression extends NodeBase {
|
|
|
13252
13246
|
initialise() {
|
|
13253
13247
|
super.initialise();
|
|
13254
13248
|
this.scope.context.addDynamicImport(this);
|
|
13255
|
-
let parent = this.parent;
|
|
13256
|
-
let withinAwaitExpression = false;
|
|
13257
|
-
let withinTopLevelAwait = false;
|
|
13258
|
-
do {
|
|
13259
|
-
if (withinAwaitExpression &&
|
|
13260
|
-
(parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)) {
|
|
13261
|
-
withinTopLevelAwait = false;
|
|
13262
|
-
}
|
|
13263
|
-
if (parent instanceof AwaitExpression) {
|
|
13264
|
-
withinAwaitExpression = true;
|
|
13265
|
-
withinTopLevelAwait = true;
|
|
13266
|
-
}
|
|
13267
|
-
} while ((parent = parent.parent));
|
|
13268
|
-
if (withinAwaitExpression && withinTopLevelAwait) {
|
|
13269
|
-
this.withinTopLevelAwait = true;
|
|
13270
|
-
}
|
|
13271
13249
|
}
|
|
13272
13250
|
parseNode(esTreeNode) {
|
|
13273
13251
|
this.sourceAstNode = esTreeNode.source;
|
|
@@ -14923,10 +14901,10 @@ SwitchStatement.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
|
14923
14901
|
|
|
14924
14902
|
class TaggedTemplateExpression extends CallExpressionBase {
|
|
14925
14903
|
get hasCheckedForWarnings() {
|
|
14926
|
-
return isFlagSet(this.flags,
|
|
14904
|
+
return isFlagSet(this.flags, 134217728 /* Flag.checkedForWarnings */);
|
|
14927
14905
|
}
|
|
14928
14906
|
set hasCheckedForWarnings(value) {
|
|
14929
|
-
this.flags = setFlag(this.flags,
|
|
14907
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.checkedForWarnings */, value);
|
|
14930
14908
|
}
|
|
14931
14909
|
bind() {
|
|
14932
14910
|
super.bind();
|
|
@@ -16830,7 +16808,7 @@ class Module {
|
|
|
16830
16808
|
this.importedFromNotTreeshaken = false;
|
|
16831
16809
|
this.importers = [];
|
|
16832
16810
|
this.includedDynamicImporters = [];
|
|
16833
|
-
this.
|
|
16811
|
+
this.includedTopLevelAwaitingDynamicImporters = new Set();
|
|
16834
16812
|
this.includedImports = new Set();
|
|
16835
16813
|
this.isExecuted = false;
|
|
16836
16814
|
this.isUserDefinedEntryPoint = false;
|
|
@@ -17690,8 +17668,10 @@ class Module {
|
|
|
17690
17668
|
if (resolution instanceof Module) {
|
|
17691
17669
|
if (!resolution.includedDynamicImporters.includes(this)) {
|
|
17692
17670
|
resolution.includedDynamicImporters.push(this);
|
|
17693
|
-
|
|
17694
|
-
|
|
17671
|
+
// If a module has a top-level await, removing this entry can create
|
|
17672
|
+
// deadlocks.
|
|
17673
|
+
if (this.astContext.usesTopLevelAwait) {
|
|
17674
|
+
resolution.includedTopLevelAwaitingDynamicImporters.add(this);
|
|
17695
17675
|
}
|
|
17696
17676
|
}
|
|
17697
17677
|
const importedNames = this.options.treeshake
|
|
@@ -19406,8 +19386,8 @@ function* concatLazy(iterables) {
|
|
|
19406
19386
|
* those chunks that are already loaded for that dynamic entry and create
|
|
19407
19387
|
* another round of chunks.
|
|
19408
19388
|
*/
|
|
19409
|
-
function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) {
|
|
19410
|
-
const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry);
|
|
19389
|
+
function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log, isManualChunksFunctionForm, onlyExplicitManualChunks) {
|
|
19390
|
+
const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry, isManualChunksFunctionForm, onlyExplicitManualChunks);
|
|
19411
19391
|
const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry } = analyzeModuleGraph(entries);
|
|
19412
19392
|
// Each chunk is identified by its position in this array
|
|
19413
19393
|
const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks));
|
|
@@ -19425,11 +19405,16 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
19425
19405
|
})));
|
|
19426
19406
|
return chunkDefinitions;
|
|
19427
19407
|
}
|
|
19428
|
-
function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry) {
|
|
19408
|
+
function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry, isManualChunksFunctionForm, onlyExplicitManualChunks) {
|
|
19429
19409
|
const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
|
|
19430
19410
|
const manualChunkModulesByAlias = Object.create(null);
|
|
19431
19411
|
for (const [entry, alias] of manualChunkAliasByEntry) {
|
|
19432
|
-
|
|
19412
|
+
if (isManualChunksFunctionForm && onlyExplicitManualChunks) {
|
|
19413
|
+
(manualChunkModulesByAlias[alias] ||= []).push(entry);
|
|
19414
|
+
}
|
|
19415
|
+
else {
|
|
19416
|
+
addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks);
|
|
19417
|
+
}
|
|
19433
19418
|
}
|
|
19434
19419
|
const manualChunks = Object.entries(manualChunkModulesByAlias);
|
|
19435
19420
|
const chunkDefinitions = new Array(manualChunks.length);
|
|
@@ -19479,8 +19464,8 @@ function analyzeModuleGraph(entries) {
|
|
|
19479
19464
|
dynamicEntryModules.add(resolution);
|
|
19480
19465
|
allEntriesSet.add(resolution);
|
|
19481
19466
|
dynamicImportsForCurrentEntry.add(resolution);
|
|
19482
|
-
for (const
|
|
19483
|
-
if (staticDependencies.has(
|
|
19467
|
+
for (const includedTopLevelAwaitingDynamicImporter of resolution.includedTopLevelAwaitingDynamicImporters) {
|
|
19468
|
+
if (staticDependencies.has(includedTopLevelAwaitingDynamicImporter)) {
|
|
19484
19469
|
awaitedDynamicEntryModules.add(resolution);
|
|
19485
19470
|
awaitedDynamicImportsForCurrentEntry.add(resolution);
|
|
19486
19471
|
break;
|
|
@@ -19503,7 +19488,7 @@ function analyzeModuleGraph(entries) {
|
|
|
19503
19488
|
allEntries,
|
|
19504
19489
|
awaitedDynamicImportsByEntry,
|
|
19505
19490
|
dependentEntriesByModule,
|
|
19506
|
-
dynamicallyDependentEntriesByAwaitedDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, awaitedDynamicEntries, allEntries, dynamicEntry => dynamicEntry.
|
|
19491
|
+
dynamicallyDependentEntriesByAwaitedDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, awaitedDynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedTopLevelAwaitingDynamicImporters),
|
|
19507
19492
|
dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedDynamicImporters),
|
|
19508
19493
|
dynamicImportsByEntry
|
|
19509
19494
|
};
|
|
@@ -19629,7 +19614,7 @@ function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyD
|
|
|
19629
19614
|
*/
|
|
19630
19615
|
function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry) {
|
|
19631
19616
|
// Remove entries from dependent entries if a chunk is already loaded without
|
|
19632
|
-
// that entry. Do not remove already loaded atoms where
|
|
19617
|
+
// that entry. Do not remove already loaded atoms where some dynamic imports
|
|
19633
19618
|
// are awaited to avoid cycles in the output.
|
|
19634
19619
|
let chunkMask = 1n;
|
|
19635
19620
|
for (const { dependentEntries } of chunkAtoms) {
|
|
@@ -20008,7 +19993,7 @@ function analyseModuleExecution(entryModules) {
|
|
|
20008
19993
|
}
|
|
20009
19994
|
for (const { resolution, node } of module.dynamicImports) {
|
|
20010
19995
|
if (resolution instanceof Module) {
|
|
20011
|
-
if (node.
|
|
19996
|
+
if (node.scope.context.usesTopLevelAwait) {
|
|
20012
19997
|
handleSyncLoadedModule(resolution, module);
|
|
20013
19998
|
}
|
|
20014
19999
|
else {
|
|
@@ -20627,7 +20612,7 @@ class Bundle {
|
|
|
20627
20612
|
this.pluginDriver.finaliseAssets();
|
|
20628
20613
|
}
|
|
20629
20614
|
async generateChunks(bundle, getHashPlaceholder) {
|
|
20630
|
-
const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
|
|
20615
|
+
const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules, onlyExplicitManualChunks } = this.outputOptions;
|
|
20631
20616
|
const manualChunkAliasByEntry = typeof manualChunks === 'object'
|
|
20632
20617
|
? await this.addManualChunks(manualChunks)
|
|
20633
20618
|
: this.assignManualChunks(manualChunks);
|
|
@@ -20639,7 +20624,7 @@ class Bundle {
|
|
|
20639
20624
|
? [{ alias: null, modules: includedModules }]
|
|
20640
20625
|
: preserveModules
|
|
20641
20626
|
? includedModules.map(module => ({ alias: null, modules: [module] }))
|
|
20642
|
-
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog);
|
|
20627
|
+
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog, typeof manualChunks === 'function', onlyExplicitManualChunks);
|
|
20643
20628
|
const chunks = new Array(executableModule.length);
|
|
20644
20629
|
const chunkByModule = new Map();
|
|
20645
20630
|
let index = 0;
|
|
@@ -23064,6 +23049,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
23064
23049
|
minifyInternalExports: getMinifyInternalExports(config, format, compact),
|
|
23065
23050
|
name: config.name,
|
|
23066
23051
|
noConflict: config.noConflict || false,
|
|
23052
|
+
onlyExplicitManualChunks: config.onlyExplicitManualChunks || false,
|
|
23067
23053
|
outro: getAddon(config, 'outro'),
|
|
23068
23054
|
paths: config.paths || {},
|
|
23069
23055
|
plugins: await normalizePluginOption(config.plugins),
|
|
@@ -23783,6 +23769,7 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
23783
23769
|
minifyInternalExports: getOption('minifyInternalExports'),
|
|
23784
23770
|
name: getOption('name'),
|
|
23785
23771
|
noConflict: getOption('noConflict'),
|
|
23772
|
+
onlyExplicitManualChunks: getOption('onlyExplicitManualChunks'),
|
|
23786
23773
|
outro: getOption('outro'),
|
|
23787
23774
|
paths: getOption('paths'),
|
|
23788
23775
|
plugins: await normalizePluginOption(config.plugins),
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -818,6 +818,8 @@ export interface OutputOptions {
|
|
|
818
818
|
minifyInternalExports?: boolean | undefined;
|
|
819
819
|
name?: string | undefined;
|
|
820
820
|
noConflict?: boolean | undefined;
|
|
821
|
+
/** @deprecated This will be the new default in Rollup 5. */
|
|
822
|
+
onlyExplicitManualChunks?: boolean | undefined;
|
|
821
823
|
outro?: string | AddonFunction | undefined;
|
|
822
824
|
paths?: OptionsPaths | undefined;
|
|
823
825
|
plugins?: OutputPluginOption | undefined;
|
|
@@ -873,6 +875,7 @@ export interface NormalizedOutputOptions {
|
|
|
873
875
|
minifyInternalExports: boolean;
|
|
874
876
|
name: string | undefined;
|
|
875
877
|
noConflict: boolean;
|
|
878
|
+
onlyExplicitManualChunks: boolean;
|
|
876
879
|
outro: AddonFunction;
|
|
877
880
|
paths: OptionsPaths;
|
|
878
881
|
plugins: OutputPlugin[];
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.52.1
|
|
4
|
+
Tue, 23 Sep 2025 04:29:13 GMT - commit 69b5dd3e3edc03ab02cf948ea5278226fc9e60c8
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
|
|
|
42
42
|
|
|
43
43
|
const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
|
|
44
44
|
|
|
45
|
-
var version = "4.
|
|
45
|
+
var version = "4.52.1";
|
|
46
46
|
|
|
47
47
|
function ensureArray$1(items) {
|
|
48
48
|
if (Array.isArray(items)) {
|
|
@@ -3677,6 +3677,7 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
3677
3677
|
minifyInternalExports: getOption('minifyInternalExports'),
|
|
3678
3678
|
name: getOption('name'),
|
|
3679
3679
|
noConflict: getOption('noConflict'),
|
|
3680
|
+
onlyExplicitManualChunks: getOption('onlyExplicitManualChunks'),
|
|
3680
3681
|
outro: getOption('outro'),
|
|
3681
3682
|
paths: getOption('paths'),
|
|
3682
3683
|
plugins: await normalizePluginOption(config.plugins),
|
|
@@ -13702,10 +13703,10 @@ class CallExpressionBase extends NodeBase {
|
|
|
13702
13703
|
|
|
13703
13704
|
class CallExpression extends CallExpressionBase {
|
|
13704
13705
|
get hasCheckedForWarnings() {
|
|
13705
|
-
return isFlagSet(this.flags,
|
|
13706
|
+
return isFlagSet(this.flags, 134217728 /* Flag.checkedForWarnings */);
|
|
13706
13707
|
}
|
|
13707
13708
|
set hasCheckedForWarnings(value) {
|
|
13708
|
-
this.flags = setFlag(this.flags,
|
|
13709
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.checkedForWarnings */, value);
|
|
13709
13710
|
}
|
|
13710
13711
|
get optional() {
|
|
13711
13712
|
return isFlagSet(this.flags, 128 /* Flag.optional */);
|
|
@@ -14735,16 +14736,10 @@ class ImportExpression extends NodeBase {
|
|
|
14735
14736
|
this.resolutionString = null;
|
|
14736
14737
|
}
|
|
14737
14738
|
get shouldIncludeDynamicAttributes() {
|
|
14738
|
-
return isFlagSet(this.flags,
|
|
14739
|
+
return isFlagSet(this.flags, 268435456 /* Flag.shouldIncludeDynamicAttributes */);
|
|
14739
14740
|
}
|
|
14740
14741
|
set shouldIncludeDynamicAttributes(value) {
|
|
14741
|
-
this.flags = setFlag(this.flags,
|
|
14742
|
-
}
|
|
14743
|
-
get withinTopLevelAwait() {
|
|
14744
|
-
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
14745
|
-
}
|
|
14746
|
-
set withinTopLevelAwait(value) {
|
|
14747
|
-
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
14742
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.shouldIncludeDynamicAttributes */, value);
|
|
14748
14743
|
}
|
|
14749
14744
|
bind() {
|
|
14750
14745
|
this.source.bind();
|
|
@@ -14768,7 +14763,7 @@ class ImportExpression extends NodeBase {
|
|
|
14768
14763
|
}
|
|
14769
14764
|
if (parent1 instanceof AwaitExpression) {
|
|
14770
14765
|
const parent2 = parent1.parent;
|
|
14771
|
-
// Side
|
|
14766
|
+
// Side effect only: await import('bar')
|
|
14772
14767
|
if (parent2 instanceof ExpressionStatement) {
|
|
14773
14768
|
return parseAst_js.EMPTY_ARRAY;
|
|
14774
14769
|
}
|
|
@@ -14861,22 +14856,6 @@ class ImportExpression extends NodeBase {
|
|
|
14861
14856
|
initialise() {
|
|
14862
14857
|
super.initialise();
|
|
14863
14858
|
this.scope.context.addDynamicImport(this);
|
|
14864
|
-
let parent = this.parent;
|
|
14865
|
-
let withinAwaitExpression = false;
|
|
14866
|
-
let withinTopLevelAwait = false;
|
|
14867
|
-
do {
|
|
14868
|
-
if (withinAwaitExpression &&
|
|
14869
|
-
(parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)) {
|
|
14870
|
-
withinTopLevelAwait = false;
|
|
14871
|
-
}
|
|
14872
|
-
if (parent instanceof AwaitExpression) {
|
|
14873
|
-
withinAwaitExpression = true;
|
|
14874
|
-
withinTopLevelAwait = true;
|
|
14875
|
-
}
|
|
14876
|
-
} while ((parent = parent.parent));
|
|
14877
|
-
if (withinAwaitExpression && withinTopLevelAwait) {
|
|
14878
|
-
this.withinTopLevelAwait = true;
|
|
14879
|
-
}
|
|
14880
14859
|
}
|
|
14881
14860
|
parseNode(esTreeNode) {
|
|
14882
14861
|
this.sourceAstNode = esTreeNode.source;
|
|
@@ -16532,10 +16511,10 @@ SwitchStatement.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
|
16532
16511
|
|
|
16533
16512
|
class TaggedTemplateExpression extends CallExpressionBase {
|
|
16534
16513
|
get hasCheckedForWarnings() {
|
|
16535
|
-
return isFlagSet(this.flags,
|
|
16514
|
+
return isFlagSet(this.flags, 134217728 /* Flag.checkedForWarnings */);
|
|
16536
16515
|
}
|
|
16537
16516
|
set hasCheckedForWarnings(value) {
|
|
16538
|
-
this.flags = setFlag(this.flags,
|
|
16517
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.checkedForWarnings */, value);
|
|
16539
16518
|
}
|
|
16540
16519
|
bind() {
|
|
16541
16520
|
super.bind();
|
|
@@ -18432,7 +18411,7 @@ class Module {
|
|
|
18432
18411
|
this.importedFromNotTreeshaken = false;
|
|
18433
18412
|
this.importers = [];
|
|
18434
18413
|
this.includedDynamicImporters = [];
|
|
18435
|
-
this.
|
|
18414
|
+
this.includedTopLevelAwaitingDynamicImporters = new Set();
|
|
18436
18415
|
this.includedImports = new Set();
|
|
18437
18416
|
this.isExecuted = false;
|
|
18438
18417
|
this.isUserDefinedEntryPoint = false;
|
|
@@ -19292,8 +19271,10 @@ class Module {
|
|
|
19292
19271
|
if (resolution instanceof Module) {
|
|
19293
19272
|
if (!resolution.includedDynamicImporters.includes(this)) {
|
|
19294
19273
|
resolution.includedDynamicImporters.push(this);
|
|
19295
|
-
|
|
19296
|
-
|
|
19274
|
+
// If a module has a top-level await, removing this entry can create
|
|
19275
|
+
// deadlocks.
|
|
19276
|
+
if (this.astContext.usesTopLevelAwait) {
|
|
19277
|
+
resolution.includedTopLevelAwaitingDynamicImporters.add(this);
|
|
19297
19278
|
}
|
|
19298
19279
|
}
|
|
19299
19280
|
const importedNames = this.options.treeshake
|
|
@@ -20899,8 +20880,8 @@ function* concatLazy(iterables) {
|
|
|
20899
20880
|
* those chunks that are already loaded for that dynamic entry and create
|
|
20900
20881
|
* another round of chunks.
|
|
20901
20882
|
*/
|
|
20902
|
-
function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) {
|
|
20903
|
-
const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry);
|
|
20883
|
+
function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log, isManualChunksFunctionForm, onlyExplicitManualChunks) {
|
|
20884
|
+
const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry, isManualChunksFunctionForm, onlyExplicitManualChunks);
|
|
20904
20885
|
const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry } = analyzeModuleGraph(entries);
|
|
20905
20886
|
// Each chunk is identified by its position in this array
|
|
20906
20887
|
const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks));
|
|
@@ -20918,11 +20899,16 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
20918
20899
|
})));
|
|
20919
20900
|
return chunkDefinitions;
|
|
20920
20901
|
}
|
|
20921
|
-
function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry) {
|
|
20902
|
+
function getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry, isManualChunksFunctionForm, onlyExplicitManualChunks) {
|
|
20922
20903
|
const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
|
|
20923
20904
|
const manualChunkModulesByAlias = Object.create(null);
|
|
20924
20905
|
for (const [entry, alias] of manualChunkAliasByEntry) {
|
|
20925
|
-
|
|
20906
|
+
if (isManualChunksFunctionForm && onlyExplicitManualChunks) {
|
|
20907
|
+
(manualChunkModulesByAlias[alias] ||= []).push(entry);
|
|
20908
|
+
}
|
|
20909
|
+
else {
|
|
20910
|
+
addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] ||= []), modulesInManualChunks);
|
|
20911
|
+
}
|
|
20926
20912
|
}
|
|
20927
20913
|
const manualChunks = Object.entries(manualChunkModulesByAlias);
|
|
20928
20914
|
const chunkDefinitions = new Array(manualChunks.length);
|
|
@@ -20972,8 +20958,8 @@ function analyzeModuleGraph(entries) {
|
|
|
20972
20958
|
dynamicEntryModules.add(resolution);
|
|
20973
20959
|
allEntriesSet.add(resolution);
|
|
20974
20960
|
dynamicImportsForCurrentEntry.add(resolution);
|
|
20975
|
-
for (const
|
|
20976
|
-
if (staticDependencies.has(
|
|
20961
|
+
for (const includedTopLevelAwaitingDynamicImporter of resolution.includedTopLevelAwaitingDynamicImporters) {
|
|
20962
|
+
if (staticDependencies.has(includedTopLevelAwaitingDynamicImporter)) {
|
|
20977
20963
|
awaitedDynamicEntryModules.add(resolution);
|
|
20978
20964
|
awaitedDynamicImportsForCurrentEntry.add(resolution);
|
|
20979
20965
|
break;
|
|
@@ -20996,7 +20982,7 @@ function analyzeModuleGraph(entries) {
|
|
|
20996
20982
|
allEntries,
|
|
20997
20983
|
awaitedDynamicImportsByEntry,
|
|
20998
20984
|
dependentEntriesByModule,
|
|
20999
|
-
dynamicallyDependentEntriesByAwaitedDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, awaitedDynamicEntries, allEntries, dynamicEntry => dynamicEntry.
|
|
20985
|
+
dynamicallyDependentEntriesByAwaitedDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, awaitedDynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedTopLevelAwaitingDynamicImporters),
|
|
21000
20986
|
dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedDynamicImporters),
|
|
21001
20987
|
dynamicImportsByEntry
|
|
21002
20988
|
};
|
|
@@ -21122,7 +21108,7 @@ function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyD
|
|
|
21122
21108
|
*/
|
|
21123
21109
|
function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry) {
|
|
21124
21110
|
// Remove entries from dependent entries if a chunk is already loaded without
|
|
21125
|
-
// that entry. Do not remove already loaded atoms where
|
|
21111
|
+
// that entry. Do not remove already loaded atoms where some dynamic imports
|
|
21126
21112
|
// are awaited to avoid cycles in the output.
|
|
21127
21113
|
let chunkMask = 1n;
|
|
21128
21114
|
for (const { dependentEntries } of chunkAtoms) {
|
|
@@ -21501,7 +21487,7 @@ function analyseModuleExecution(entryModules) {
|
|
|
21501
21487
|
}
|
|
21502
21488
|
for (const { resolution, node } of module.dynamicImports) {
|
|
21503
21489
|
if (resolution instanceof Module) {
|
|
21504
|
-
if (node.
|
|
21490
|
+
if (node.scope.context.usesTopLevelAwait) {
|
|
21505
21491
|
handleSyncLoadedModule(resolution, module);
|
|
21506
21492
|
}
|
|
21507
21493
|
else {
|
|
@@ -22100,7 +22086,7 @@ class Bundle {
|
|
|
22100
22086
|
this.pluginDriver.finaliseAssets();
|
|
22101
22087
|
}
|
|
22102
22088
|
async generateChunks(bundle, getHashPlaceholder) {
|
|
22103
|
-
const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
|
|
22089
|
+
const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules, onlyExplicitManualChunks } = this.outputOptions;
|
|
22104
22090
|
const manualChunkAliasByEntry = typeof manualChunks === 'object'
|
|
22105
22091
|
? await this.addManualChunks(manualChunks)
|
|
22106
22092
|
: this.assignManualChunks(manualChunks);
|
|
@@ -22112,7 +22098,7 @@ class Bundle {
|
|
|
22112
22098
|
? [{ alias: null, modules: includedModules }]
|
|
22113
22099
|
: preserveModules
|
|
22114
22100
|
? includedModules.map(module => ({ alias: null, modules: [module] }))
|
|
22115
|
-
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog);
|
|
22101
|
+
: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog, typeof manualChunks === 'function', onlyExplicitManualChunks);
|
|
22116
22102
|
const chunks = new Array(executableModule.length);
|
|
22117
22103
|
const chunkByModule = new Map();
|
|
22118
22104
|
let index = 0;
|
|
@@ -23400,6 +23386,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
23400
23386
|
minifyInternalExports: getMinifyInternalExports(config, format, compact),
|
|
23401
23387
|
name: config.name,
|
|
23402
23388
|
noConflict: config.noConflict || false,
|
|
23389
|
+
onlyExplicitManualChunks: config.onlyExplicitManualChunks || false,
|
|
23403
23390
|
outro: getAddon(config, 'outro'),
|
|
23404
23391
|
paths: config.paths || {},
|
|
23405
23392
|
plugins: await normalizePluginOption(config.plugins),
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.52.1",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -106,28 +106,28 @@
|
|
|
106
106
|
"homepage": "https://rollupjs.org/",
|
|
107
107
|
"optionalDependencies": {
|
|
108
108
|
"fsevents": "~2.3.2",
|
|
109
|
-
"@rollup/rollup-darwin-arm64": "4.
|
|
110
|
-
"@rollup/rollup-android-arm64": "4.
|
|
111
|
-
"@rollup/rollup-win32-arm64-msvc": "4.
|
|
112
|
-
"@rollup/rollup-freebsd-arm64": "4.
|
|
113
|
-
"@rollup/rollup-linux-arm64-gnu": "4.
|
|
114
|
-
"@rollup/rollup-linux-arm64-musl": "4.
|
|
115
|
-
"@rollup/rollup-android-arm-eabi": "4.
|
|
116
|
-
"@rollup/rollup-linux-arm-gnueabihf": "4.
|
|
117
|
-
"@rollup/rollup-linux-arm-musleabihf": "4.
|
|
118
|
-
"@rollup/rollup-win32-ia32-msvc": "4.
|
|
119
|
-
"@rollup/rollup-linux-loong64-gnu": "4.
|
|
120
|
-
"@rollup/rollup-linux-riscv64-gnu": "4.
|
|
121
|
-
"@rollup/rollup-linux-riscv64-musl": "4.
|
|
122
|
-
"@rollup/rollup-linux-ppc64-gnu": "4.
|
|
123
|
-
"@rollup/rollup-linux-s390x-gnu": "4.
|
|
124
|
-
"@rollup/rollup-darwin-x64": "4.
|
|
125
|
-
"@rollup/rollup-win32-x64-gnu": "4.
|
|
126
|
-
"@rollup/rollup-win32-x64-msvc": "4.
|
|
127
|
-
"@rollup/rollup-freebsd-x64": "4.
|
|
128
|
-
"@rollup/rollup-linux-x64-gnu": "4.
|
|
129
|
-
"@rollup/rollup-linux-x64-musl": "4.
|
|
130
|
-
"@rollup/rollup-openharmony-arm64": "4.
|
|
109
|
+
"@rollup/rollup-darwin-arm64": "4.52.1",
|
|
110
|
+
"@rollup/rollup-android-arm64": "4.52.1",
|
|
111
|
+
"@rollup/rollup-win32-arm64-msvc": "4.52.1",
|
|
112
|
+
"@rollup/rollup-freebsd-arm64": "4.52.1",
|
|
113
|
+
"@rollup/rollup-linux-arm64-gnu": "4.52.1",
|
|
114
|
+
"@rollup/rollup-linux-arm64-musl": "4.52.1",
|
|
115
|
+
"@rollup/rollup-android-arm-eabi": "4.52.1",
|
|
116
|
+
"@rollup/rollup-linux-arm-gnueabihf": "4.52.1",
|
|
117
|
+
"@rollup/rollup-linux-arm-musleabihf": "4.52.1",
|
|
118
|
+
"@rollup/rollup-win32-ia32-msvc": "4.52.1",
|
|
119
|
+
"@rollup/rollup-linux-loong64-gnu": "4.52.1",
|
|
120
|
+
"@rollup/rollup-linux-riscv64-gnu": "4.52.1",
|
|
121
|
+
"@rollup/rollup-linux-riscv64-musl": "4.52.1",
|
|
122
|
+
"@rollup/rollup-linux-ppc64-gnu": "4.52.1",
|
|
123
|
+
"@rollup/rollup-linux-s390x-gnu": "4.52.1",
|
|
124
|
+
"@rollup/rollup-darwin-x64": "4.52.1",
|
|
125
|
+
"@rollup/rollup-win32-x64-gnu": "4.52.1",
|
|
126
|
+
"@rollup/rollup-win32-x64-msvc": "4.52.1",
|
|
127
|
+
"@rollup/rollup-freebsd-x64": "4.52.1",
|
|
128
|
+
"@rollup/rollup-linux-x64-gnu": "4.52.1",
|
|
129
|
+
"@rollup/rollup-linux-x64-musl": "4.52.1",
|
|
130
|
+
"@rollup/rollup-openharmony-arm64": "4.52.1"
|
|
131
131
|
},
|
|
132
132
|
"dependencies": {
|
|
133
133
|
"@types/estree": "1.0.8"
|