rollup 3.6.0-1 → 3.6.1-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/rollup.js +2 -2
- package/dist/es/shared/rollup.js +87 -38
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +2 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +87 -38
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/bin/rollup
CHANGED
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 v3.6.0
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.6.1-0
|
|
4
|
+
Tue, 06 Dec 2022 05:39:23 GMT - commit 1bff93da4b04d4e723793dd37607ec7775ba28dd
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.6.0
|
|
19
|
+
var version$1 = "3.6.1-0";
|
|
20
20
|
|
|
21
21
|
var charToInteger = {};
|
|
22
22
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -2629,6 +2629,8 @@ class ExternalModule {
|
|
|
2629
2629
|
get dynamicImporters() {
|
|
2630
2630
|
return dynamicImporters.sort();
|
|
2631
2631
|
},
|
|
2632
|
+
exportedBindings: null,
|
|
2633
|
+
exports: null,
|
|
2632
2634
|
hasDefaultExport: null,
|
|
2633
2635
|
get hasModuleSideEffects() {
|
|
2634
2636
|
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
@@ -12820,7 +12822,7 @@ class Module {
|
|
|
12820
12822
|
this.preserveSignature = this.options.preserveEntrySignatures;
|
|
12821
12823
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
12822
12824
|
const module = this;
|
|
12823
|
-
const { dynamicImports, dynamicImporters, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAssertions } = this;
|
|
12825
|
+
const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAssertions } = this;
|
|
12824
12826
|
this.info = {
|
|
12825
12827
|
assertions,
|
|
12826
12828
|
ast: null,
|
|
@@ -12838,6 +12840,23 @@ class Module {
|
|
|
12838
12840
|
get dynamicImporters() {
|
|
12839
12841
|
return dynamicImporters.sort();
|
|
12840
12842
|
},
|
|
12843
|
+
get exportedBindings() {
|
|
12844
|
+
const exportBindings = { '.': [...exports.keys()] };
|
|
12845
|
+
for (const [name, { source }] of reexportDescriptions) {
|
|
12846
|
+
(exportBindings[source] ?? (exportBindings[source] = [])).push(name);
|
|
12847
|
+
}
|
|
12848
|
+
for (const source of exportAllSources) {
|
|
12849
|
+
(exportBindings[source] ?? (exportBindings[source] = [])).push('*');
|
|
12850
|
+
}
|
|
12851
|
+
return exportBindings;
|
|
12852
|
+
},
|
|
12853
|
+
get exports() {
|
|
12854
|
+
return [
|
|
12855
|
+
...exports.keys(),
|
|
12856
|
+
...reexportDescriptions.keys(),
|
|
12857
|
+
...[...exportAllSources].map(() => '*')
|
|
12858
|
+
];
|
|
12859
|
+
},
|
|
12841
12860
|
get hasDefaultExport() {
|
|
12842
12861
|
// This information is only valid after parsing
|
|
12843
12862
|
if (!module.ast) {
|
|
@@ -16026,49 +16045,70 @@ function getPartitionedChunks(chunkModulesBySignature, minChunkSize) {
|
|
|
16026
16045
|
const bigPureChunks = [];
|
|
16027
16046
|
const smallSideEffectChunks = [];
|
|
16028
16047
|
const bigSideEffectChunks = [];
|
|
16048
|
+
const chunkByModule = new Map();
|
|
16029
16049
|
for (const [signature, modules] of Object.entries(chunkModulesBySignature)) {
|
|
16050
|
+
const chunkDescription = {
|
|
16051
|
+
dependencies: new Set(),
|
|
16052
|
+
modules,
|
|
16053
|
+
pure: true,
|
|
16054
|
+
signature,
|
|
16055
|
+
size: 0,
|
|
16056
|
+
transitiveDependencies: new Set(),
|
|
16057
|
+
transitiveDependentChunks: new Set()
|
|
16058
|
+
};
|
|
16030
16059
|
let size = 0;
|
|
16031
16060
|
let pure = true;
|
|
16032
|
-
const dependencies = new Set();
|
|
16033
|
-
const transitiveDependencies = new Set();
|
|
16034
16061
|
for (const module of modules) {
|
|
16062
|
+
chunkByModule.set(module, chunkDescription);
|
|
16035
16063
|
pure && (pure = !module.hasEffects());
|
|
16036
16064
|
size += module.magicString.toString().length;
|
|
16037
|
-
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16038
|
-
if (!(dependency instanceof ExternalModule)) {
|
|
16039
|
-
dependencies.add(dependency);
|
|
16040
|
-
transitiveDependencies.add(dependency);
|
|
16041
|
-
}
|
|
16042
|
-
}
|
|
16043
|
-
}
|
|
16044
|
-
for (const module of transitiveDependencies) {
|
|
16045
|
-
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16046
|
-
if (!(dependency instanceof ExternalModule)) {
|
|
16047
|
-
transitiveDependencies.add(dependency);
|
|
16048
|
-
}
|
|
16049
|
-
}
|
|
16050
16065
|
}
|
|
16066
|
+
chunkDescription.pure = pure;
|
|
16067
|
+
chunkDescription.size = size;
|
|
16051
16068
|
(size < minChunkSize
|
|
16052
16069
|
? pure
|
|
16053
16070
|
? smallPureChunks
|
|
16054
16071
|
: smallSideEffectChunks
|
|
16055
16072
|
: pure
|
|
16056
16073
|
? bigPureChunks
|
|
16057
|
-
: bigSideEffectChunks).push(
|
|
16058
|
-
}
|
|
16059
|
-
for (const chunks of [
|
|
16060
|
-
bigPureChunks,
|
|
16061
|
-
bigSideEffectChunks,
|
|
16062
|
-
smallPureChunks,
|
|
16063
|
-
smallSideEffectChunks
|
|
16064
|
-
]) {
|
|
16065
|
-
chunks.sort(compareChunks);
|
|
16074
|
+
: bigSideEffectChunks).push(chunkDescription);
|
|
16066
16075
|
}
|
|
16076
|
+
sortChunksAndAddDependencies([bigPureChunks, bigSideEffectChunks, smallPureChunks, smallSideEffectChunks], chunkByModule);
|
|
16067
16077
|
return {
|
|
16068
16078
|
big: { pure: new Set(bigPureChunks), sideEffect: new Set(bigSideEffectChunks) },
|
|
16069
16079
|
small: { pure: new Set(smallPureChunks), sideEffect: new Set(smallSideEffectChunks) }
|
|
16070
16080
|
};
|
|
16071
16081
|
}
|
|
16082
|
+
function sortChunksAndAddDependencies(chunkLists, chunkByModule) {
|
|
16083
|
+
for (const chunks of chunkLists) {
|
|
16084
|
+
chunks.sort(compareChunks);
|
|
16085
|
+
for (const chunk of chunks) {
|
|
16086
|
+
const { dependencies, modules, transitiveDependencies } = chunk;
|
|
16087
|
+
const transitiveDependencyModules = new Set();
|
|
16088
|
+
for (const module of modules) {
|
|
16089
|
+
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16090
|
+
const dependencyChunk = chunkByModule.get(dependency);
|
|
16091
|
+
if (dependencyChunk && dependencyChunk !== chunk) {
|
|
16092
|
+
dependencies.add(dependencyChunk);
|
|
16093
|
+
transitiveDependencyModules.add(dependency);
|
|
16094
|
+
}
|
|
16095
|
+
}
|
|
16096
|
+
}
|
|
16097
|
+
for (const module of transitiveDependencyModules) {
|
|
16098
|
+
const transitiveDependency = chunkByModule.get(module);
|
|
16099
|
+
if (transitiveDependency !== chunk) {
|
|
16100
|
+
transitiveDependencies.add(transitiveDependency);
|
|
16101
|
+
transitiveDependency.transitiveDependentChunks.add(chunk);
|
|
16102
|
+
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16103
|
+
if (!(dependency instanceof ExternalModule)) {
|
|
16104
|
+
transitiveDependencyModules.add(dependency);
|
|
16105
|
+
}
|
|
16106
|
+
}
|
|
16107
|
+
}
|
|
16108
|
+
}
|
|
16109
|
+
}
|
|
16110
|
+
}
|
|
16111
|
+
}
|
|
16072
16112
|
function compareChunks({ size: sizeA }, { size: sizeB }) {
|
|
16073
16113
|
return sizeA - sizeB;
|
|
16074
16114
|
}
|
|
@@ -16099,13 +16139,27 @@ function mergeChunks(chunksToBeMerged, targetChunks, minChunkSize, chunkPartitio
|
|
|
16099
16139
|
closestChunk.size += size;
|
|
16100
16140
|
closestChunk.pure && (closestChunk.pure = pure);
|
|
16101
16141
|
closestChunk.signature = mergeSignatures(signature, closestChunk.signature);
|
|
16102
|
-
const { dependencies, transitiveDependencies } = closestChunk;
|
|
16142
|
+
const { dependencies, transitiveDependencies, transitiveDependentChunks } = closestChunk;
|
|
16103
16143
|
for (const dependency of mergedChunk.dependencies) {
|
|
16104
16144
|
dependencies.add(dependency);
|
|
16105
16145
|
}
|
|
16106
16146
|
for (const dependency of mergedChunk.transitiveDependencies) {
|
|
16107
16147
|
transitiveDependencies.add(dependency);
|
|
16148
|
+
dependency.transitiveDependentChunks.delete(mergedChunk);
|
|
16149
|
+
dependency.transitiveDependentChunks.add(closestChunk);
|
|
16150
|
+
}
|
|
16151
|
+
for (const dependentChunk of mergedChunk.transitiveDependentChunks) {
|
|
16152
|
+
transitiveDependentChunks.add(dependentChunk);
|
|
16153
|
+
if (dependentChunk.dependencies.has(mergedChunk)) {
|
|
16154
|
+
dependentChunk.dependencies.delete(mergedChunk);
|
|
16155
|
+
dependentChunk.dependencies.add(closestChunk);
|
|
16156
|
+
}
|
|
16157
|
+
dependentChunk.transitiveDependencies.delete(mergedChunk);
|
|
16158
|
+
dependentChunk.transitiveDependencies.add(closestChunk);
|
|
16108
16159
|
}
|
|
16160
|
+
dependencies.delete(closestChunk);
|
|
16161
|
+
transitiveDependencies.delete(closestChunk);
|
|
16162
|
+
transitiveDependentChunks.delete(closestChunk);
|
|
16109
16163
|
getChunksInPartition(closestChunk, minChunkSize, chunkPartition).add(closestChunk);
|
|
16110
16164
|
}
|
|
16111
16165
|
}
|
|
@@ -16113,15 +16167,10 @@ function mergeChunks(chunksToBeMerged, targetChunks, minChunkSize, chunkPartitio
|
|
|
16113
16167
|
// If a module is a transitive but not a direct dependency of the other chunk,
|
|
16114
16168
|
// merging is prohibited as that would create a new cyclic dependency.
|
|
16115
16169
|
function isValidMerge(mergedChunk, targetChunk) {
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
for (const module of targetChunk.modules) {
|
|
16121
|
-
if (mergedChunk.transitiveDependencies.has(module) && !mergedChunk.dependencies.has(module))
|
|
16122
|
-
return false;
|
|
16123
|
-
}
|
|
16124
|
-
return true;
|
|
16170
|
+
return ((!targetChunk.transitiveDependencies.has(mergedChunk) ||
|
|
16171
|
+
targetChunk.dependencies.has(mergedChunk)) &&
|
|
16172
|
+
(!mergedChunk.transitiveDependencies.has(targetChunk) ||
|
|
16173
|
+
mergedChunk.dependencies.has(targetChunk)));
|
|
16125
16174
|
}
|
|
16126
16175
|
function getChunksInPartition(chunk, minChunkSize, chunkPartition) {
|
|
16127
16176
|
const subPartition = chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big;
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -157,6 +157,8 @@ interface ModuleInfo extends ModuleOptions {
|
|
|
157
157
|
dynamicImporters: readonly string[];
|
|
158
158
|
dynamicallyImportedIdResolutions: readonly ResolvedId[];
|
|
159
159
|
dynamicallyImportedIds: readonly string[];
|
|
160
|
+
exportedBindings: Record<string, string[]> | null;
|
|
161
|
+
exports: string[] | null;
|
|
160
162
|
hasDefaultExport: boolean | null;
|
|
161
163
|
/** @deprecated Use `moduleSideEffects` instead */
|
|
162
164
|
hasModuleSideEffects: boolean | 'no-treeshake';
|
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.6.0
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.6.1-0
|
|
4
|
+
Tue, 06 Dec 2022 05:39:23 GMT - commit 1bff93da4b04d4e723793dd37607ec7775ba28dd
|
|
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$1 = "3.6.0
|
|
34
|
+
var version$1 = "3.6.1-0";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -3142,6 +3142,8 @@ class ExternalModule {
|
|
|
3142
3142
|
get dynamicImporters() {
|
|
3143
3143
|
return dynamicImporters.sort();
|
|
3144
3144
|
},
|
|
3145
|
+
exportedBindings: null,
|
|
3146
|
+
exports: null,
|
|
3145
3147
|
hasDefaultExport: null,
|
|
3146
3148
|
get hasModuleSideEffects() {
|
|
3147
3149
|
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
@@ -13335,7 +13337,7 @@ class Module {
|
|
|
13335
13337
|
this.preserveSignature = this.options.preserveEntrySignatures;
|
|
13336
13338
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
13337
13339
|
const module = this;
|
|
13338
|
-
const { dynamicImports, dynamicImporters, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAssertions } = this;
|
|
13340
|
+
const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAssertions } = this;
|
|
13339
13341
|
this.info = {
|
|
13340
13342
|
assertions,
|
|
13341
13343
|
ast: null,
|
|
@@ -13353,6 +13355,23 @@ class Module {
|
|
|
13353
13355
|
get dynamicImporters() {
|
|
13354
13356
|
return dynamicImporters.sort();
|
|
13355
13357
|
},
|
|
13358
|
+
get exportedBindings() {
|
|
13359
|
+
const exportBindings = { '.': [...exports.keys()] };
|
|
13360
|
+
for (const [name, { source }] of reexportDescriptions) {
|
|
13361
|
+
(exportBindings[source] ?? (exportBindings[source] = [])).push(name);
|
|
13362
|
+
}
|
|
13363
|
+
for (const source of exportAllSources) {
|
|
13364
|
+
(exportBindings[source] ?? (exportBindings[source] = [])).push('*');
|
|
13365
|
+
}
|
|
13366
|
+
return exportBindings;
|
|
13367
|
+
},
|
|
13368
|
+
get exports() {
|
|
13369
|
+
return [
|
|
13370
|
+
...exports.keys(),
|
|
13371
|
+
...reexportDescriptions.keys(),
|
|
13372
|
+
...[...exportAllSources].map(() => '*')
|
|
13373
|
+
];
|
|
13374
|
+
},
|
|
13356
13375
|
get hasDefaultExport() {
|
|
13357
13376
|
// This information is only valid after parsing
|
|
13358
13377
|
if (!module.ast) {
|
|
@@ -16541,49 +16560,70 @@ function getPartitionedChunks(chunkModulesBySignature, minChunkSize) {
|
|
|
16541
16560
|
const bigPureChunks = [];
|
|
16542
16561
|
const smallSideEffectChunks = [];
|
|
16543
16562
|
const bigSideEffectChunks = [];
|
|
16563
|
+
const chunkByModule = new Map();
|
|
16544
16564
|
for (const [signature, modules] of Object.entries(chunkModulesBySignature)) {
|
|
16565
|
+
const chunkDescription = {
|
|
16566
|
+
dependencies: new Set(),
|
|
16567
|
+
modules,
|
|
16568
|
+
pure: true,
|
|
16569
|
+
signature,
|
|
16570
|
+
size: 0,
|
|
16571
|
+
transitiveDependencies: new Set(),
|
|
16572
|
+
transitiveDependentChunks: new Set()
|
|
16573
|
+
};
|
|
16545
16574
|
let size = 0;
|
|
16546
16575
|
let pure = true;
|
|
16547
|
-
const dependencies = new Set();
|
|
16548
|
-
const transitiveDependencies = new Set();
|
|
16549
16576
|
for (const module of modules) {
|
|
16577
|
+
chunkByModule.set(module, chunkDescription);
|
|
16550
16578
|
pure && (pure = !module.hasEffects());
|
|
16551
16579
|
size += module.magicString.toString().length;
|
|
16552
|
-
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16553
|
-
if (!(dependency instanceof ExternalModule)) {
|
|
16554
|
-
dependencies.add(dependency);
|
|
16555
|
-
transitiveDependencies.add(dependency);
|
|
16556
|
-
}
|
|
16557
|
-
}
|
|
16558
|
-
}
|
|
16559
|
-
for (const module of transitiveDependencies) {
|
|
16560
|
-
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16561
|
-
if (!(dependency instanceof ExternalModule)) {
|
|
16562
|
-
transitiveDependencies.add(dependency);
|
|
16563
|
-
}
|
|
16564
|
-
}
|
|
16565
16580
|
}
|
|
16581
|
+
chunkDescription.pure = pure;
|
|
16582
|
+
chunkDescription.size = size;
|
|
16566
16583
|
(size < minChunkSize
|
|
16567
16584
|
? pure
|
|
16568
16585
|
? smallPureChunks
|
|
16569
16586
|
: smallSideEffectChunks
|
|
16570
16587
|
: pure
|
|
16571
16588
|
? bigPureChunks
|
|
16572
|
-
: bigSideEffectChunks).push(
|
|
16573
|
-
}
|
|
16574
|
-
for (const chunks of [
|
|
16575
|
-
bigPureChunks,
|
|
16576
|
-
bigSideEffectChunks,
|
|
16577
|
-
smallPureChunks,
|
|
16578
|
-
smallSideEffectChunks
|
|
16579
|
-
]) {
|
|
16580
|
-
chunks.sort(compareChunks);
|
|
16589
|
+
: bigSideEffectChunks).push(chunkDescription);
|
|
16581
16590
|
}
|
|
16591
|
+
sortChunksAndAddDependencies([bigPureChunks, bigSideEffectChunks, smallPureChunks, smallSideEffectChunks], chunkByModule);
|
|
16582
16592
|
return {
|
|
16583
16593
|
big: { pure: new Set(bigPureChunks), sideEffect: new Set(bigSideEffectChunks) },
|
|
16584
16594
|
small: { pure: new Set(smallPureChunks), sideEffect: new Set(smallSideEffectChunks) }
|
|
16585
16595
|
};
|
|
16586
16596
|
}
|
|
16597
|
+
function sortChunksAndAddDependencies(chunkLists, chunkByModule) {
|
|
16598
|
+
for (const chunks of chunkLists) {
|
|
16599
|
+
chunks.sort(compareChunks);
|
|
16600
|
+
for (const chunk of chunks) {
|
|
16601
|
+
const { dependencies, modules, transitiveDependencies } = chunk;
|
|
16602
|
+
const transitiveDependencyModules = new Set();
|
|
16603
|
+
for (const module of modules) {
|
|
16604
|
+
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16605
|
+
const dependencyChunk = chunkByModule.get(dependency);
|
|
16606
|
+
if (dependencyChunk && dependencyChunk !== chunk) {
|
|
16607
|
+
dependencies.add(dependencyChunk);
|
|
16608
|
+
transitiveDependencyModules.add(dependency);
|
|
16609
|
+
}
|
|
16610
|
+
}
|
|
16611
|
+
}
|
|
16612
|
+
for (const module of transitiveDependencyModules) {
|
|
16613
|
+
const transitiveDependency = chunkByModule.get(module);
|
|
16614
|
+
if (transitiveDependency !== chunk) {
|
|
16615
|
+
transitiveDependencies.add(transitiveDependency);
|
|
16616
|
+
transitiveDependency.transitiveDependentChunks.add(chunk);
|
|
16617
|
+
for (const dependency of module.getDependenciesToBeIncluded()) {
|
|
16618
|
+
if (!(dependency instanceof ExternalModule)) {
|
|
16619
|
+
transitiveDependencyModules.add(dependency);
|
|
16620
|
+
}
|
|
16621
|
+
}
|
|
16622
|
+
}
|
|
16623
|
+
}
|
|
16624
|
+
}
|
|
16625
|
+
}
|
|
16626
|
+
}
|
|
16587
16627
|
function compareChunks({ size: sizeA }, { size: sizeB }) {
|
|
16588
16628
|
return sizeA - sizeB;
|
|
16589
16629
|
}
|
|
@@ -16614,13 +16654,27 @@ function mergeChunks(chunksToBeMerged, targetChunks, minChunkSize, chunkPartitio
|
|
|
16614
16654
|
closestChunk.size += size;
|
|
16615
16655
|
closestChunk.pure && (closestChunk.pure = pure);
|
|
16616
16656
|
closestChunk.signature = mergeSignatures(signature, closestChunk.signature);
|
|
16617
|
-
const { dependencies, transitiveDependencies } = closestChunk;
|
|
16657
|
+
const { dependencies, transitiveDependencies, transitiveDependentChunks } = closestChunk;
|
|
16618
16658
|
for (const dependency of mergedChunk.dependencies) {
|
|
16619
16659
|
dependencies.add(dependency);
|
|
16620
16660
|
}
|
|
16621
16661
|
for (const dependency of mergedChunk.transitiveDependencies) {
|
|
16622
16662
|
transitiveDependencies.add(dependency);
|
|
16663
|
+
dependency.transitiveDependentChunks.delete(mergedChunk);
|
|
16664
|
+
dependency.transitiveDependentChunks.add(closestChunk);
|
|
16665
|
+
}
|
|
16666
|
+
for (const dependentChunk of mergedChunk.transitiveDependentChunks) {
|
|
16667
|
+
transitiveDependentChunks.add(dependentChunk);
|
|
16668
|
+
if (dependentChunk.dependencies.has(mergedChunk)) {
|
|
16669
|
+
dependentChunk.dependencies.delete(mergedChunk);
|
|
16670
|
+
dependentChunk.dependencies.add(closestChunk);
|
|
16671
|
+
}
|
|
16672
|
+
dependentChunk.transitiveDependencies.delete(mergedChunk);
|
|
16673
|
+
dependentChunk.transitiveDependencies.add(closestChunk);
|
|
16623
16674
|
}
|
|
16675
|
+
dependencies.delete(closestChunk);
|
|
16676
|
+
transitiveDependencies.delete(closestChunk);
|
|
16677
|
+
transitiveDependentChunks.delete(closestChunk);
|
|
16624
16678
|
getChunksInPartition(closestChunk, minChunkSize, chunkPartition).add(closestChunk);
|
|
16625
16679
|
}
|
|
16626
16680
|
}
|
|
@@ -16628,15 +16682,10 @@ function mergeChunks(chunksToBeMerged, targetChunks, minChunkSize, chunkPartitio
|
|
|
16628
16682
|
// If a module is a transitive but not a direct dependency of the other chunk,
|
|
16629
16683
|
// merging is prohibited as that would create a new cyclic dependency.
|
|
16630
16684
|
function isValidMerge(mergedChunk, targetChunk) {
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
for (const module of targetChunk.modules) {
|
|
16636
|
-
if (mergedChunk.transitiveDependencies.has(module) && !mergedChunk.dependencies.has(module))
|
|
16637
|
-
return false;
|
|
16638
|
-
}
|
|
16639
|
-
return true;
|
|
16685
|
+
return ((!targetChunk.transitiveDependencies.has(mergedChunk) ||
|
|
16686
|
+
targetChunk.dependencies.has(mergedChunk)) &&
|
|
16687
|
+
(!mergedChunk.transitiveDependencies.has(targetChunk) ||
|
|
16688
|
+
mergedChunk.dependencies.has(targetChunk)));
|
|
16640
16689
|
}
|
|
16641
16690
|
function getChunksInPartition(chunk, minChunkSize, chunkPartition) {
|
|
16642
16691
|
const subPartition = chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big;
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED