rollup 2.77.2 → 2.77.4-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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +52 -45
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +52 -45
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +2 -2
package/dist/es/rollup.js
CHANGED
package/dist/es/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.77.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.77.4-0
|
|
4
|
+
Sun, 04 Dec 2022 18:27:04 GMT - commit 43b5e1cddb8a5b9ae0aa6349112523b5b89db783
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ import { createHash as createHash$1 } from 'crypto';
|
|
|
14
14
|
import { promises } from 'fs';
|
|
15
15
|
import { EventEmitter } from 'events';
|
|
16
16
|
|
|
17
|
-
var version$1 = "2.77.
|
|
17
|
+
var version$1 = "2.77.4-0";
|
|
18
18
|
|
|
19
19
|
var charToInteger = {};
|
|
20
20
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -14604,7 +14604,7 @@ class Chunk {
|
|
|
14604
14604
|
});
|
|
14605
14605
|
const currentPath = `${currentDir}/${fileName}`;
|
|
14606
14606
|
const { preserveModulesRoot } = options;
|
|
14607
|
-
if (preserveModulesRoot && currentPath.startsWith(preserveModulesRoot)) {
|
|
14607
|
+
if (preserveModulesRoot && resolve(currentPath).startsWith(preserveModulesRoot)) {
|
|
14608
14608
|
path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, '');
|
|
14609
14609
|
}
|
|
14610
14610
|
else {
|
|
@@ -15658,23 +15658,21 @@ function getChunkAssignments(entryModules, manualChunkAliasByEntry) {
|
|
|
15658
15658
|
const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
|
|
15659
15659
|
const manualChunkModulesByAlias = Object.create(null);
|
|
15660
15660
|
for (const [entry, alias] of manualChunkAliasByEntry) {
|
|
15661
|
-
|
|
15662
|
-
manualChunkModulesByAlias[alias] || []);
|
|
15663
|
-
addStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);
|
|
15661
|
+
addStaticDependenciesToManualChunk(entry, (manualChunkModulesByAlias[alias] || (manualChunkModulesByAlias[alias] = [])), modulesInManualChunks);
|
|
15664
15662
|
}
|
|
15665
15663
|
for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {
|
|
15666
15664
|
chunkDefinitions.push({ alias, modules });
|
|
15667
15665
|
}
|
|
15668
15666
|
const assignedEntryPointsByModule = new Map();
|
|
15669
|
-
const { dependentEntryPointsByModule,
|
|
15670
|
-
const
|
|
15671
|
-
|
|
15672
|
-
function assignEntryToStaticDependencies(entry, dynamicDependentEntryPoints) {
|
|
15667
|
+
const { allModules, dependentEntryPointsByModule, dynamicallyDependentEntryPointsByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entryModules);
|
|
15668
|
+
const alreadyLoadedModulesByDynamicEntry = getAlreadyLoadedModulesByDynamicEntry(allModules, dependentEntryPointsByModule, dynamicImportsByEntry, dynamicallyDependentEntryPointsByDynamicEntry);
|
|
15669
|
+
function assignEntryToStaticDependencies(entry, alreadyLoadedModules) {
|
|
15673
15670
|
const modulesToHandle = new Set([entry]);
|
|
15674
15671
|
for (const module of modulesToHandle) {
|
|
15675
15672
|
const assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());
|
|
15676
|
-
|
|
15677
|
-
|
|
15673
|
+
// If the module is "already loaded" for this dynamic entry, we do not need
|
|
15674
|
+
// to mark it for this dynamic entry
|
|
15675
|
+
if (alreadyLoadedModules === null || alreadyLoadedModules === void 0 ? void 0 : alreadyLoadedModules.has(module)) {
|
|
15678
15676
|
continue;
|
|
15679
15677
|
}
|
|
15680
15678
|
else {
|
|
@@ -15687,31 +15685,17 @@ function getChunkAssignments(entryModules, manualChunkAliasByEntry) {
|
|
|
15687
15685
|
}
|
|
15688
15686
|
}
|
|
15689
15687
|
}
|
|
15690
|
-
function areEntryPointsContainedOrDynamicallyDependent(entryPoints, containedIn) {
|
|
15691
|
-
const entriesToCheck = new Set(entryPoints);
|
|
15692
|
-
for (const entry of entriesToCheck) {
|
|
15693
|
-
if (!containedIn.has(entry)) {
|
|
15694
|
-
if (staticEntries.has(entry))
|
|
15695
|
-
return false;
|
|
15696
|
-
const dynamicallyDependentEntryPoints = dynamicallyDependentEntryPointsByDynamicEntry.get(entry);
|
|
15697
|
-
for (const dependentEntry of dynamicallyDependentEntryPoints) {
|
|
15698
|
-
entriesToCheck.add(dependentEntry);
|
|
15699
|
-
}
|
|
15700
|
-
}
|
|
15701
|
-
}
|
|
15702
|
-
return true;
|
|
15703
|
-
}
|
|
15704
15688
|
for (const entry of entryModules) {
|
|
15705
15689
|
if (!modulesInManualChunks.has(entry)) {
|
|
15706
15690
|
assignEntryToStaticDependencies(entry, null);
|
|
15707
15691
|
}
|
|
15708
15692
|
}
|
|
15709
|
-
for (const entry of
|
|
15693
|
+
for (const entry of dynamicallyDependentEntryPointsByDynamicEntry.keys()) {
|
|
15710
15694
|
if (!modulesInManualChunks.has(entry)) {
|
|
15711
|
-
assignEntryToStaticDependencies(entry,
|
|
15695
|
+
assignEntryToStaticDependencies(entry, alreadyLoadedModulesByDynamicEntry.get(entry) || null);
|
|
15712
15696
|
}
|
|
15713
15697
|
}
|
|
15714
|
-
chunkDefinitions.push(...createChunks([...entryModules, ...
|
|
15698
|
+
chunkDefinitions.push(...createChunks([...entryModules, ...dynamicallyDependentEntryPointsByDynamicEntry.keys()], assignedEntryPointsByModule));
|
|
15715
15699
|
return chunkDefinitions;
|
|
15716
15700
|
}
|
|
15717
15701
|
function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) {
|
|
@@ -15727,46 +15711,69 @@ function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesIn
|
|
|
15727
15711
|
}
|
|
15728
15712
|
}
|
|
15729
15713
|
function analyzeModuleGraph(entryModules) {
|
|
15730
|
-
const
|
|
15714
|
+
const allModules = new Set(entryModules);
|
|
15731
15715
|
const dependentEntryPointsByModule = new Map();
|
|
15716
|
+
const dynamicImportsByEntry = new Map();
|
|
15717
|
+
const dynamicallyDependentEntryPointsByDynamicEntry = new Map();
|
|
15732
15718
|
const entriesToHandle = new Set(entryModules);
|
|
15733
15719
|
for (const currentEntry of entriesToHandle) {
|
|
15734
15720
|
const modulesToHandle = new Set([currentEntry]);
|
|
15721
|
+
const dynamicImports = new Set();
|
|
15722
|
+
dynamicImportsByEntry.set(currentEntry, dynamicImports);
|
|
15735
15723
|
for (const module of modulesToHandle) {
|
|
15736
15724
|
getOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);
|
|
15737
15725
|
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
15738
15726
|
if (!(dependency instanceof ExternalModule)) {
|
|
15739
15727
|
modulesToHandle.add(dependency);
|
|
15728
|
+
allModules.add(dependency);
|
|
15740
15729
|
}
|
|
15741
15730
|
}
|
|
15742
15731
|
for (const { resolution } of module.dynamicImports) {
|
|
15743
15732
|
if (resolution instanceof Module && resolution.includedDynamicImporters.length > 0) {
|
|
15744
|
-
|
|
15733
|
+
dynamicImports.add(resolution);
|
|
15734
|
+
getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, resolution, () => new Set()).add(currentEntry);
|
|
15745
15735
|
entriesToHandle.add(resolution);
|
|
15736
|
+
allModules.add(resolution);
|
|
15746
15737
|
}
|
|
15747
15738
|
}
|
|
15748
15739
|
for (const dependency of module.implicitlyLoadedBefore) {
|
|
15749
|
-
|
|
15740
|
+
dynamicImports.add(dependency);
|
|
15741
|
+
getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, dependency, () => new Set()).add(currentEntry);
|
|
15750
15742
|
entriesToHandle.add(dependency);
|
|
15743
|
+
allModules.add(dependency);
|
|
15751
15744
|
}
|
|
15752
15745
|
}
|
|
15753
15746
|
}
|
|
15754
|
-
return {
|
|
15747
|
+
return {
|
|
15748
|
+
allModules,
|
|
15749
|
+
dependentEntryPointsByModule,
|
|
15750
|
+
dynamicallyDependentEntryPointsByDynamicEntry,
|
|
15751
|
+
dynamicImportsByEntry
|
|
15752
|
+
};
|
|
15755
15753
|
}
|
|
15756
|
-
function
|
|
15757
|
-
|
|
15758
|
-
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
...
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15754
|
+
function getAlreadyLoadedModulesByDynamicEntry(allModules, dependentEntryPointsByModule, dynamicImportsByEntry, dynamicallyDependentEntryPointsByDynamicEntry) {
|
|
15755
|
+
var _a, _b;
|
|
15756
|
+
const alreadyLoadedModulesByEntry = new Map();
|
|
15757
|
+
for (const module of allModules) {
|
|
15758
|
+
const dependentEntryPoints = dependentEntryPointsByModule.get(module);
|
|
15759
|
+
for (const entry of dependentEntryPoints) {
|
|
15760
|
+
const dynamicEntriesToHandle = [...dynamicImportsByEntry.get(entry)];
|
|
15761
|
+
nextDynamicEntry: for (const dynamicEntry of dynamicEntriesToHandle) {
|
|
15762
|
+
if ((_a = alreadyLoadedModulesByEntry.get(dynamicEntry)) === null || _a === void 0 ? void 0 : _a.has(module)) {
|
|
15763
|
+
continue;
|
|
15764
|
+
}
|
|
15765
|
+
for (const siblingDependentEntry of dynamicallyDependentEntryPointsByDynamicEntry.get(dynamicEntry)) {
|
|
15766
|
+
if (!(dependentEntryPoints.has(siblingDependentEntry) ||
|
|
15767
|
+
((_b = alreadyLoadedModulesByEntry.get(siblingDependentEntry)) === null || _b === void 0 ? void 0 : _b.has(module)))) {
|
|
15768
|
+
continue nextDynamicEntry;
|
|
15769
|
+
}
|
|
15770
|
+
}
|
|
15771
|
+
getOrCreate(alreadyLoadedModulesByEntry, dynamicEntry, () => new Set()).add(module);
|
|
15772
|
+
dynamicEntriesToHandle.push(...dynamicImportsByEntry.get(dynamicEntry));
|
|
15766
15773
|
}
|
|
15767
15774
|
}
|
|
15768
15775
|
}
|
|
15769
|
-
return
|
|
15776
|
+
return alreadyLoadedModulesByEntry;
|
|
15770
15777
|
}
|
|
15771
15778
|
function createChunks(allEntryPoints, assignedEntryPointsByModule) {
|
|
15772
15779
|
const chunkModules = Object.create(null);
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED