"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/angular_devkit/build_angular/src/webpack/utils/async-chunks.ts" between
angular-cli-12.0.3.tar.gz and angular-cli-12.0.4.tar.gz

About: Angular CLI is a command line interface for Angular.

async-chunks.ts  (angular-cli-12.0.3):async-chunks.ts  (angular-cli-12.0.4)
skipping to change at line 30 skipping to change at line 30
extraEntryPoints: NormalizedEntryPoint[], extraEntryPoints: NormalizedEntryPoint[],
): StatsChunk[] { ): StatsChunk[] {
const { chunks = [], entrypoints: entryPoints = {} } = webpackStats; const { chunks = [], entrypoints: entryPoints = {} } = webpackStats;
// Find all Webpack chunk IDs not injected into the main bundle. We don't have // Find all Webpack chunk IDs not injected into the main bundle. We don't have
// to worry about transitive dependencies because extra entry points cannot be // to worry about transitive dependencies because extra entry points cannot be
// depended upon in Webpack, thus any extra entry point with `inject: false`, // depended upon in Webpack, thus any extra entry point with `inject: false`,
// **cannot** be loaded in main bundle. // **cannot** be loaded in main bundle.
const asyncChunkIds = extraEntryPoints const asyncChunkIds = extraEntryPoints
.filter((entryPoint) => !entryPoint.inject) .filter((entryPoint) => !entryPoint.inject)
.flatMap((entryPoint) => entryPoints[entryPoint.bundleName].chunks); .flatMap((entryPoint) =>
entryPoints[entryPoint.bundleName].chunks?.filter((n) => n !== 'runtime'),
);
// Find chunks for each ID. // Find chunks for each ID.
const asyncChunks = asyncChunkIds.map((chunkId) => { const asyncChunks = asyncChunkIds.map((chunkId) => {
const chunk = chunks.find((chunk) => chunk.id === chunkId); const chunk = chunks.find((chunk) => chunk.id === chunkId);
if (!chunk) { if (!chunk) {
throw new Error(`Failed to find chunk (${chunkId}) in set:\n${JSON.stringi fy(chunks)}`); throw new Error(`Failed to find chunk (${chunkId}) in set:\n${JSON.stringi fy(chunks)}`);
} }
return chunk; return chunk;
}); });
// A chunk is considered `initial` only if Webpack already belives it to be in itial // A chunk is considered `initial` only if Webpack already belives it to be in itial
// and the application developer did not mark it async via an extra entry poin t. // and the application developer did not mark it async via an extra entry poin t.
return chunks.map((chunk) => ({ return chunks.map((chunk) => {
...chunk, return asyncChunks.find((asyncChunk) => asyncChunk === chunk)
initial: chunk.initial && !asyncChunks.find((asyncChunk) => asyncChunk === c ? {
hunk), ...chunk,
})); initial: false,
}
: chunk;
});
} }
 End of changes. 2 change blocks. 
6 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)