rollup 3.17.1 → 3.17.3-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/node-entry.js +93 -9
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +1 -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/rollup.js +93 -9
- 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/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.17.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.17.3-0
|
|
4
|
+
Wed, 22 Feb 2023 06:04:55 GMT - commit b4fddb7fd14781e68b8271c09b41f248afb8e4c1
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/pr
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.17.
|
|
19
|
+
var version$1 = "3.17.3-0";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -5701,8 +5701,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
5701
5701
|
}
|
|
5702
5702
|
addExportedVariables(_variables, _exportNamesByVariable) { }
|
|
5703
5703
|
/**
|
|
5704
|
-
* Override this to bind assignments to variables and do any initialisations
|
|
5705
|
-
* require the scopes to be populated with variables.
|
|
5704
|
+
* Override this to bind assignments to variables and do any initialisations
|
|
5705
|
+
* that require the scopes to be populated with variables.
|
|
5706
5706
|
*/
|
|
5707
5707
|
bind() {
|
|
5708
5708
|
for (const key of this.keys) {
|
|
@@ -5718,7 +5718,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
5718
5718
|
}
|
|
5719
5719
|
}
|
|
5720
5720
|
/**
|
|
5721
|
-
* Override if this node should receive a different scope than the parent
|
|
5721
|
+
* Override if this node should receive a different scope than the parent
|
|
5722
|
+
* scope.
|
|
5722
5723
|
*/
|
|
5723
5724
|
createScope(parentScope) {
|
|
5724
5725
|
this.scope = parentScope;
|
|
@@ -5767,7 +5768,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
5767
5768
|
this.include(context, includeChildrenRecursively);
|
|
5768
5769
|
}
|
|
5769
5770
|
/**
|
|
5770
|
-
* Override to perform special initialisation steps after the scope is
|
|
5771
|
+
* Override to perform special initialisation steps after the scope is
|
|
5772
|
+
* initialised
|
|
5771
5773
|
*/
|
|
5772
5774
|
initialise() { }
|
|
5773
5775
|
insertSemicolon(code) {
|
|
@@ -5849,6 +5851,23 @@ class NodeBase extends ExpressionEntity {
|
|
|
5849
5851
|
this.context.requestTreeshakingPass();
|
|
5850
5852
|
}
|
|
5851
5853
|
}
|
|
5854
|
+
function logNode(node) {
|
|
5855
|
+
return node.context.code.slice(node.start, node.end);
|
|
5856
|
+
}
|
|
5857
|
+
function logEffect(node, module) {
|
|
5858
|
+
if (!module.hasLoggedEffect) {
|
|
5859
|
+
module.hasLoggedEffect = true;
|
|
5860
|
+
let effect = logNode(node);
|
|
5861
|
+
let truncated = false;
|
|
5862
|
+
if (effect.length > 150) {
|
|
5863
|
+
truncated = true;
|
|
5864
|
+
effect = effect.slice(0, 150) + '...';
|
|
5865
|
+
}
|
|
5866
|
+
console.log(`==> First side effect in ${relativeId(module.id)}${truncated ? ' (truncated)' : ''}:`);
|
|
5867
|
+
console.log(effect);
|
|
5868
|
+
console.log('<==\n');
|
|
5869
|
+
}
|
|
5870
|
+
}
|
|
5852
5871
|
|
|
5853
5872
|
class SpreadElement extends NodeBase {
|
|
5854
5873
|
deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) {
|
|
@@ -7172,6 +7191,7 @@ const knownGlobals = {
|
|
|
7172
7191
|
defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7173
7192
|
freeze: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7174
7193
|
getOwnPropertyDescriptor: PF,
|
|
7194
|
+
getOwnPropertyDescriptors: PF,
|
|
7175
7195
|
getOwnPropertyNames: PF,
|
|
7176
7196
|
getOwnPropertySymbols: PF,
|
|
7177
7197
|
getPrototypeOf: PF,
|
|
@@ -7191,6 +7211,8 @@ const knownGlobals = {
|
|
|
7191
7211
|
__proto__: null,
|
|
7192
7212
|
[ValueProperties]: IMPURE,
|
|
7193
7213
|
all: O,
|
|
7214
|
+
allSettled: O,
|
|
7215
|
+
any: O,
|
|
7194
7216
|
prototype: O,
|
|
7195
7217
|
race: O,
|
|
7196
7218
|
reject: O,
|
|
@@ -8321,8 +8343,10 @@ class BlockStatement extends NodeBase {
|
|
|
8321
8343
|
for (const node of this.body) {
|
|
8322
8344
|
if (context.brokenFlow)
|
|
8323
8345
|
break;
|
|
8324
|
-
if (node.hasEffects(context))
|
|
8346
|
+
if (node.hasEffects(context)) {
|
|
8347
|
+
logEffect(node, this.context.module);
|
|
8325
8348
|
return true;
|
|
8349
|
+
}
|
|
8326
8350
|
}
|
|
8327
8351
|
return false;
|
|
8328
8352
|
}
|
|
@@ -11444,6 +11468,7 @@ class Program extends NodeBase {
|
|
|
11444
11468
|
hasEffects(context) {
|
|
11445
11469
|
for (const node of this.body) {
|
|
11446
11470
|
if (node.hasEffects(context)) {
|
|
11471
|
+
logEffect(node, this.context.module);
|
|
11447
11472
|
return (this.hasCachedEffect = true);
|
|
11448
11473
|
}
|
|
11449
11474
|
}
|
|
@@ -13009,6 +13034,7 @@ class Module {
|
|
|
13009
13034
|
this.dynamicImporters = [];
|
|
13010
13035
|
this.dynamicImports = [];
|
|
13011
13036
|
this.execIndex = Infinity;
|
|
13037
|
+
this.hasLoggedEffect = false;
|
|
13012
13038
|
this.implicitlyLoadedAfter = new Set();
|
|
13013
13039
|
this.implicitlyLoadedBefore = new Set();
|
|
13014
13040
|
this.importDescriptions = new Map();
|
|
@@ -13295,6 +13321,9 @@ class Module {
|
|
|
13295
13321
|
}
|
|
13296
13322
|
if (importerForSideEffects) {
|
|
13297
13323
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
13324
|
+
if (this.info.moduleSideEffects) {
|
|
13325
|
+
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13326
|
+
}
|
|
13298
13327
|
}
|
|
13299
13328
|
return [variable];
|
|
13300
13329
|
}
|
|
@@ -13309,8 +13338,8 @@ class Module {
|
|
|
13309
13338
|
searchedNamesAndModules
|
|
13310
13339
|
});
|
|
13311
13340
|
if (importerForSideEffects) {
|
|
13312
|
-
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13313
13341
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
13342
|
+
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13314
13343
|
}
|
|
13315
13344
|
return [variable];
|
|
13316
13345
|
}
|
|
@@ -16548,6 +16577,8 @@ function compareChunkSize({ size: sizeA }, { size: sizeB }) {
|
|
|
16548
16577
|
return sizeA - sizeB;
|
|
16549
16578
|
}
|
|
16550
16579
|
function mergeChunks(chunkPartition, minChunkSize) {
|
|
16580
|
+
console.log('---- Initial chunks');
|
|
16581
|
+
printConsistencyCheck(chunkPartition);
|
|
16551
16582
|
for (const allowArbitraryMerges of [false, true]) {
|
|
16552
16583
|
for (const mergedChunk of chunkPartition.small) {
|
|
16553
16584
|
let closestChunk = null;
|
|
@@ -16599,6 +16630,8 @@ function mergeChunks(chunkPartition, minChunkSize) {
|
|
|
16599
16630
|
getChunksInPartition(closestChunk, minChunkSize, chunkPartition).add(closestChunk);
|
|
16600
16631
|
}
|
|
16601
16632
|
}
|
|
16633
|
+
console.log('---- After run with arbitrary merges:', allowArbitraryMerges);
|
|
16634
|
+
printConsistencyCheck(chunkPartition);
|
|
16602
16635
|
}
|
|
16603
16636
|
}
|
|
16604
16637
|
// Merging will not produce cycles if none of the direct non-merged dependencies
|
|
@@ -16654,6 +16687,57 @@ function getChunkEntryDistance({ dependentEntries: sourceEntries }, { dependentE
|
|
|
16654
16687
|
}
|
|
16655
16688
|
return distance;
|
|
16656
16689
|
}
|
|
16690
|
+
function printConsistencyCheck(partition) {
|
|
16691
|
+
const chunks = new Set([...partition.big, ...partition.small]);
|
|
16692
|
+
console.log('Number of cycles:', getNumberOfCycles(chunks));
|
|
16693
|
+
let missingDependencies = 0;
|
|
16694
|
+
let missingDependentChunks = 0;
|
|
16695
|
+
const seenModules = new Set();
|
|
16696
|
+
for (const { modules, dependencies, dependentChunks } of chunks) {
|
|
16697
|
+
for (const module of modules) {
|
|
16698
|
+
if (seenModules.has(module)) {
|
|
16699
|
+
console.log(`Module ${module.id} is duplicated between chunks.`);
|
|
16700
|
+
}
|
|
16701
|
+
seenModules.add(module);
|
|
16702
|
+
}
|
|
16703
|
+
for (const dependency of dependencies) {
|
|
16704
|
+
if (!chunks.has(dependency)) {
|
|
16705
|
+
missingDependencies++;
|
|
16706
|
+
}
|
|
16707
|
+
}
|
|
16708
|
+
for (const dependency of dependentChunks) {
|
|
16709
|
+
if (!chunks.has(dependency)) {
|
|
16710
|
+
missingDependentChunks++;
|
|
16711
|
+
}
|
|
16712
|
+
}
|
|
16713
|
+
}
|
|
16714
|
+
console.log(`Missing\n dependencies: ${missingDependencies},\n missing dependent chunks: ${missingDependentChunks}\n`);
|
|
16715
|
+
}
|
|
16716
|
+
function getNumberOfCycles(chunks) {
|
|
16717
|
+
const parents = new Set();
|
|
16718
|
+
const analysedChunks = new Set();
|
|
16719
|
+
let cycles = 0;
|
|
16720
|
+
const analyseChunk = (chunk) => {
|
|
16721
|
+
for (const dependency of chunk.dependencies) {
|
|
16722
|
+
if (parents.has(dependency)) {
|
|
16723
|
+
if (!analysedChunks.has(dependency)) {
|
|
16724
|
+
cycles++;
|
|
16725
|
+
}
|
|
16726
|
+
continue;
|
|
16727
|
+
}
|
|
16728
|
+
parents.add(dependency);
|
|
16729
|
+
analyseChunk(dependency);
|
|
16730
|
+
}
|
|
16731
|
+
analysedChunks.add(chunk);
|
|
16732
|
+
};
|
|
16733
|
+
for (const chunk of chunks) {
|
|
16734
|
+
if (!parents.has(chunk)) {
|
|
16735
|
+
parents.add(chunk);
|
|
16736
|
+
analyseChunk(chunk);
|
|
16737
|
+
}
|
|
16738
|
+
}
|
|
16739
|
+
return cycles;
|
|
16740
|
+
}
|
|
16657
16741
|
|
|
16658
16742
|
// ported from https://github.com/substack/node-commondir
|
|
16659
16743
|
function commondir(files) {
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
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.17.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.17.3-0
|
|
4
|
+
Wed, 22 Feb 2023 06:04:55 GMT - commit b4fddb7fd14781e68b8271c09b41f248afb8e4c1
|
|
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.17.
|
|
34
|
+
var version$1 = "3.17.3-0";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -6198,8 +6198,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
6198
6198
|
}
|
|
6199
6199
|
addExportedVariables(_variables, _exportNamesByVariable) { }
|
|
6200
6200
|
/**
|
|
6201
|
-
* Override this to bind assignments to variables and do any initialisations
|
|
6202
|
-
* require the scopes to be populated with variables.
|
|
6201
|
+
* Override this to bind assignments to variables and do any initialisations
|
|
6202
|
+
* that require the scopes to be populated with variables.
|
|
6203
6203
|
*/
|
|
6204
6204
|
bind() {
|
|
6205
6205
|
for (const key of this.keys) {
|
|
@@ -6215,7 +6215,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
}
|
|
6217
6217
|
/**
|
|
6218
|
-
* Override if this node should receive a different scope than the parent
|
|
6218
|
+
* Override if this node should receive a different scope than the parent
|
|
6219
|
+
* scope.
|
|
6219
6220
|
*/
|
|
6220
6221
|
createScope(parentScope) {
|
|
6221
6222
|
this.scope = parentScope;
|
|
@@ -6264,7 +6265,8 @@ class NodeBase extends ExpressionEntity {
|
|
|
6264
6265
|
this.include(context, includeChildrenRecursively);
|
|
6265
6266
|
}
|
|
6266
6267
|
/**
|
|
6267
|
-
* Override to perform special initialisation steps after the scope is
|
|
6268
|
+
* Override to perform special initialisation steps after the scope is
|
|
6269
|
+
* initialised
|
|
6268
6270
|
*/
|
|
6269
6271
|
initialise() { }
|
|
6270
6272
|
insertSemicolon(code) {
|
|
@@ -6346,6 +6348,23 @@ class NodeBase extends ExpressionEntity {
|
|
|
6346
6348
|
this.context.requestTreeshakingPass();
|
|
6347
6349
|
}
|
|
6348
6350
|
}
|
|
6351
|
+
function logNode(node) {
|
|
6352
|
+
return node.context.code.slice(node.start, node.end);
|
|
6353
|
+
}
|
|
6354
|
+
function logEffect(node, module) {
|
|
6355
|
+
if (!module.hasLoggedEffect) {
|
|
6356
|
+
module.hasLoggedEffect = true;
|
|
6357
|
+
let effect = logNode(node);
|
|
6358
|
+
let truncated = false;
|
|
6359
|
+
if (effect.length > 150) {
|
|
6360
|
+
truncated = true;
|
|
6361
|
+
effect = effect.slice(0, 150) + '...';
|
|
6362
|
+
}
|
|
6363
|
+
console.log(`==> First side effect in ${relativeId(module.id)}${truncated ? ' (truncated)' : ''}:`);
|
|
6364
|
+
console.log(effect);
|
|
6365
|
+
console.log('<==\n');
|
|
6366
|
+
}
|
|
6367
|
+
}
|
|
6349
6368
|
|
|
6350
6369
|
class SpreadElement extends NodeBase {
|
|
6351
6370
|
deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) {
|
|
@@ -7669,6 +7688,7 @@ const knownGlobals = {
|
|
|
7669
7688
|
defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7670
7689
|
freeze: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7671
7690
|
getOwnPropertyDescriptor: PF,
|
|
7691
|
+
getOwnPropertyDescriptors: PF,
|
|
7672
7692
|
getOwnPropertyNames: PF,
|
|
7673
7693
|
getOwnPropertySymbols: PF,
|
|
7674
7694
|
getPrototypeOf: PF,
|
|
@@ -7688,6 +7708,8 @@ const knownGlobals = {
|
|
|
7688
7708
|
__proto__: null,
|
|
7689
7709
|
[ValueProperties]: IMPURE,
|
|
7690
7710
|
all: O,
|
|
7711
|
+
allSettled: O,
|
|
7712
|
+
any: O,
|
|
7691
7713
|
prototype: O,
|
|
7692
7714
|
race: O,
|
|
7693
7715
|
reject: O,
|
|
@@ -8818,8 +8840,10 @@ class BlockStatement extends NodeBase {
|
|
|
8818
8840
|
for (const node of this.body) {
|
|
8819
8841
|
if (context.brokenFlow)
|
|
8820
8842
|
break;
|
|
8821
|
-
if (node.hasEffects(context))
|
|
8843
|
+
if (node.hasEffects(context)) {
|
|
8844
|
+
logEffect(node, this.context.module);
|
|
8822
8845
|
return true;
|
|
8846
|
+
}
|
|
8823
8847
|
}
|
|
8824
8848
|
return false;
|
|
8825
8849
|
}
|
|
@@ -11941,6 +11965,7 @@ class Program extends NodeBase {
|
|
|
11941
11965
|
hasEffects(context) {
|
|
11942
11966
|
for (const node of this.body) {
|
|
11943
11967
|
if (node.hasEffects(context)) {
|
|
11968
|
+
logEffect(node, this.context.module);
|
|
11944
11969
|
return (this.hasCachedEffect = true);
|
|
11945
11970
|
}
|
|
11946
11971
|
}
|
|
@@ -13506,6 +13531,7 @@ class Module {
|
|
|
13506
13531
|
this.dynamicImporters = [];
|
|
13507
13532
|
this.dynamicImports = [];
|
|
13508
13533
|
this.execIndex = Infinity;
|
|
13534
|
+
this.hasLoggedEffect = false;
|
|
13509
13535
|
this.implicitlyLoadedAfter = new Set();
|
|
13510
13536
|
this.implicitlyLoadedBefore = new Set();
|
|
13511
13537
|
this.importDescriptions = new Map();
|
|
@@ -13792,6 +13818,9 @@ class Module {
|
|
|
13792
13818
|
}
|
|
13793
13819
|
if (importerForSideEffects) {
|
|
13794
13820
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
13821
|
+
if (this.info.moduleSideEffects) {
|
|
13822
|
+
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13823
|
+
}
|
|
13795
13824
|
}
|
|
13796
13825
|
return [variable];
|
|
13797
13826
|
}
|
|
@@ -13806,8 +13835,8 @@ class Module {
|
|
|
13806
13835
|
searchedNamesAndModules
|
|
13807
13836
|
});
|
|
13808
13837
|
if (importerForSideEffects) {
|
|
13809
|
-
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13810
13838
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
13839
|
+
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
13811
13840
|
}
|
|
13812
13841
|
return [variable];
|
|
13813
13842
|
}
|
|
@@ -17045,6 +17074,8 @@ function compareChunkSize({ size: sizeA }, { size: sizeB }) {
|
|
|
17045
17074
|
return sizeA - sizeB;
|
|
17046
17075
|
}
|
|
17047
17076
|
function mergeChunks(chunkPartition, minChunkSize) {
|
|
17077
|
+
console.log('---- Initial chunks');
|
|
17078
|
+
printConsistencyCheck(chunkPartition);
|
|
17048
17079
|
for (const allowArbitraryMerges of [false, true]) {
|
|
17049
17080
|
for (const mergedChunk of chunkPartition.small) {
|
|
17050
17081
|
let closestChunk = null;
|
|
@@ -17096,6 +17127,8 @@ function mergeChunks(chunkPartition, minChunkSize) {
|
|
|
17096
17127
|
getChunksInPartition(closestChunk, minChunkSize, chunkPartition).add(closestChunk);
|
|
17097
17128
|
}
|
|
17098
17129
|
}
|
|
17130
|
+
console.log('---- After run with arbitrary merges:', allowArbitraryMerges);
|
|
17131
|
+
printConsistencyCheck(chunkPartition);
|
|
17099
17132
|
}
|
|
17100
17133
|
}
|
|
17101
17134
|
// Merging will not produce cycles if none of the direct non-merged dependencies
|
|
@@ -17151,6 +17184,57 @@ function getChunkEntryDistance({ dependentEntries: sourceEntries }, { dependentE
|
|
|
17151
17184
|
}
|
|
17152
17185
|
return distance;
|
|
17153
17186
|
}
|
|
17187
|
+
function printConsistencyCheck(partition) {
|
|
17188
|
+
const chunks = new Set([...partition.big, ...partition.small]);
|
|
17189
|
+
console.log('Number of cycles:', getNumberOfCycles(chunks));
|
|
17190
|
+
let missingDependencies = 0;
|
|
17191
|
+
let missingDependentChunks = 0;
|
|
17192
|
+
const seenModules = new Set();
|
|
17193
|
+
for (const { modules, dependencies, dependentChunks } of chunks) {
|
|
17194
|
+
for (const module of modules) {
|
|
17195
|
+
if (seenModules.has(module)) {
|
|
17196
|
+
console.log(`Module ${module.id} is duplicated between chunks.`);
|
|
17197
|
+
}
|
|
17198
|
+
seenModules.add(module);
|
|
17199
|
+
}
|
|
17200
|
+
for (const dependency of dependencies) {
|
|
17201
|
+
if (!chunks.has(dependency)) {
|
|
17202
|
+
missingDependencies++;
|
|
17203
|
+
}
|
|
17204
|
+
}
|
|
17205
|
+
for (const dependency of dependentChunks) {
|
|
17206
|
+
if (!chunks.has(dependency)) {
|
|
17207
|
+
missingDependentChunks++;
|
|
17208
|
+
}
|
|
17209
|
+
}
|
|
17210
|
+
}
|
|
17211
|
+
console.log(`Missing\n dependencies: ${missingDependencies},\n missing dependent chunks: ${missingDependentChunks}\n`);
|
|
17212
|
+
}
|
|
17213
|
+
function getNumberOfCycles(chunks) {
|
|
17214
|
+
const parents = new Set();
|
|
17215
|
+
const analysedChunks = new Set();
|
|
17216
|
+
let cycles = 0;
|
|
17217
|
+
const analyseChunk = (chunk) => {
|
|
17218
|
+
for (const dependency of chunk.dependencies) {
|
|
17219
|
+
if (parents.has(dependency)) {
|
|
17220
|
+
if (!analysedChunks.has(dependency)) {
|
|
17221
|
+
cycles++;
|
|
17222
|
+
}
|
|
17223
|
+
continue;
|
|
17224
|
+
}
|
|
17225
|
+
parents.add(dependency);
|
|
17226
|
+
analyseChunk(dependency);
|
|
17227
|
+
}
|
|
17228
|
+
analysedChunks.add(chunk);
|
|
17229
|
+
};
|
|
17230
|
+
for (const chunk of chunks) {
|
|
17231
|
+
if (!parents.has(chunk)) {
|
|
17232
|
+
parents.add(chunk);
|
|
17233
|
+
analyseChunk(chunk);
|
|
17234
|
+
}
|
|
17235
|
+
}
|
|
17236
|
+
return cycles;
|
|
17237
|
+
}
|
|
17154
17238
|
|
|
17155
17239
|
// ported from https://github.com/substack/node-commondir
|
|
17156
17240
|
function commondir(files) {
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED