rollup-plugin-webpack-stats 1.2.4-beta.4 → 1.2.4-beta.5
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/transform.cjs +14 -14
- package/dist/transform.d.ts +2 -2
- package/dist/transform.mjs +14 -14
- package/package.json +1 -1
package/dist/transform.cjs
CHANGED
|
@@ -56,36 +56,36 @@ function checkExcludeFilepath(filepath, option) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Recursivily check if a chunk is async based on the chunks
|
|
59
|
+
* Recursivily check if a chunk is async based on the chunks issuers
|
|
60
60
|
*/
|
|
61
|
-
const lookupChunkAsync = (chunk,
|
|
61
|
+
const lookupChunkAsync = (chunk, chunksIssuers) => {
|
|
62
62
|
if (chunk.isDynamicEntry) {
|
|
63
63
|
return true;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const chunkIssuers = chunksIssuers[chunk.fileName];
|
|
66
66
|
/**
|
|
67
|
-
* A sync chunk without
|
|
67
|
+
* A sync chunk without issuer chunks, is sync
|
|
68
68
|
*/
|
|
69
|
-
if (!
|
|
69
|
+
if (!chunkIssuers) {
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
return
|
|
72
|
+
const syncChunksIssuers = chunkIssuers.filter((chunkIssuer) => {
|
|
73
|
+
return chunkIssuer.isDynamicEntry === false;
|
|
74
74
|
});
|
|
75
75
|
/**
|
|
76
|
-
* A sync chunk with all the
|
|
76
|
+
* A sync chunk with all the chunk issuer async, is async
|
|
77
77
|
*/
|
|
78
|
-
if (
|
|
78
|
+
if (syncChunksIssuers.length === 0) {
|
|
79
79
|
return true;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Recursively lookup for sync loads on the 2nd level
|
|
83
|
-
* - if at least one
|
|
84
|
-
* - if none of the
|
|
82
|
+
* Recursively lookup for sync loads on the 2nd level issuers
|
|
83
|
+
* - if at least one issuer is sync, the chunk is sync
|
|
84
|
+
* - if none of the issuers are sync, the chunk is async
|
|
85
85
|
*/
|
|
86
86
|
let isAsync = true;
|
|
87
|
-
for (let i = 0; i <
|
|
88
|
-
isAsync = lookupChunkAsync(
|
|
87
|
+
for (let i = 0; i < syncChunksIssuers.length && isAsync; i++) {
|
|
88
|
+
isAsync = lookupChunkAsync(syncChunksIssuers[i], chunksIssuers);
|
|
89
89
|
}
|
|
90
90
|
return isAsync;
|
|
91
91
|
};
|
package/dist/transform.d.ts
CHANGED
|
@@ -32,9 +32,9 @@ export interface WebpackStatsFiltered {
|
|
|
32
32
|
}
|
|
33
33
|
export type ChunksIssuers = Record<string, Array<OutputChunk>>;
|
|
34
34
|
/**
|
|
35
|
-
* Recursivily check if a chunk is async based on the chunks
|
|
35
|
+
* Recursivily check if a chunk is async based on the chunks issuers
|
|
36
36
|
*/
|
|
37
|
-
export declare const lookupChunkAsync: (chunk: OutputChunk,
|
|
37
|
+
export declare const lookupChunkAsync: (chunk: OutputChunk, chunksIssuers: ChunksIssuers) => boolean;
|
|
38
38
|
type AssetSource = OutputChunk | OutputAsset;
|
|
39
39
|
type ChunkSource = OutputChunk;
|
|
40
40
|
type ModuleSource = {
|
package/dist/transform.mjs
CHANGED
|
@@ -54,36 +54,36 @@ function checkExcludeFilepath(filepath, option) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Recursivily check if a chunk is async based on the chunks
|
|
57
|
+
* Recursivily check if a chunk is async based on the chunks issuers
|
|
58
58
|
*/
|
|
59
|
-
const lookupChunkAsync = (chunk,
|
|
59
|
+
const lookupChunkAsync = (chunk, chunksIssuers) => {
|
|
60
60
|
if (chunk.isDynamicEntry) {
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const chunkIssuers = chunksIssuers[chunk.fileName];
|
|
64
64
|
/**
|
|
65
|
-
* A sync chunk without
|
|
65
|
+
* A sync chunk without issuer chunks, is sync
|
|
66
66
|
*/
|
|
67
|
-
if (!
|
|
67
|
+
if (!chunkIssuers) {
|
|
68
68
|
return false;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
return
|
|
70
|
+
const syncChunksIssuers = chunkIssuers.filter((chunkIssuer) => {
|
|
71
|
+
return chunkIssuer.isDynamicEntry === false;
|
|
72
72
|
});
|
|
73
73
|
/**
|
|
74
|
-
* A sync chunk with all the
|
|
74
|
+
* A sync chunk with all the chunk issuer async, is async
|
|
75
75
|
*/
|
|
76
|
-
if (
|
|
76
|
+
if (syncChunksIssuers.length === 0) {
|
|
77
77
|
return true;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* Recursively lookup for sync loads on the 2nd level
|
|
81
|
-
* - if at least one
|
|
82
|
-
* - if none of the
|
|
80
|
+
* Recursively lookup for sync loads on the 2nd level issuers
|
|
81
|
+
* - if at least one issuer is sync, the chunk is sync
|
|
82
|
+
* - if none of the issuers are sync, the chunk is async
|
|
83
83
|
*/
|
|
84
84
|
let isAsync = true;
|
|
85
|
-
for (let i = 0; i <
|
|
86
|
-
isAsync = lookupChunkAsync(
|
|
85
|
+
for (let i = 0; i < syncChunksIssuers.length && isAsync; i++) {
|
|
86
|
+
isAsync = lookupChunkAsync(syncChunksIssuers[i], chunksIssuers);
|
|
87
87
|
}
|
|
88
88
|
return isAsync;
|
|
89
89
|
};
|