Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): maxModules were deprecated and re…
Browse files Browse the repository at this point in the history
…named to modulesSpace
  • Loading branch information
valorkin authored and alan-agius4 committed Sep 28, 2020
1 parent f4887fd commit 92f3889
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -7,6 +7,7 @@
*/

import { WebpackConfigOptions } from '../../utils/build-options';
import { isWebpackFiveOrHigher } from '../../utils/webpack-version';

const webpackOutputOptions = {
colors: true,
Expand All @@ -25,11 +26,10 @@ const webpackOutputOptions = {
moduleTrace: false,
};

const verboseWebpackOutputOptions = {
const verboseWebpackOutputOptions: Record<string, boolean | string | number> = {
// The verbose output will most likely be piped to a file, so colors just mess it up.
colors: false,
usedExports: true,
maxModules: Infinity,
optimizationBailout: true,
reasons: true,
children: true,
Expand All @@ -41,6 +41,12 @@ const verboseWebpackOutputOptions = {
logging: 'verbose',
};

if (isWebpackFiveOrHigher()) {
verboseWebpackOutputOptions['modulesSpace'] = Infinity;
} else {
verboseWebpackOutputOptions['maxModules'] = Infinity;
}

export function getWebpackStatsConfig(verbose = false) {
return verbose
? { ...webpackOutputOptions, ...verboseWebpackOutputOptions }
Expand Down

0 comments on commit 92f3889

Please sign in to comment.