refactor(@angular-devkit/build-angular): fully temporarily disable Webpack 5 license extraction

This commit is contained in:
Charles Lyding 2020-10-13 10:43:32 -04:00 committed by Filipe Silva
parent 2fa17219d1
commit a4d31fd16e
2 changed files with 12 additions and 8 deletions

View File

@ -54,6 +54,7 @@ import {
getIndexInputFile,
getIndexOutputFile,
} from '../utils/webpack-browser-config';
import { isWebpackFiveOrHigher } from '../utils/webpack-version';
import {
getAotConfig,
getBrowserConfig,
@ -176,6 +177,15 @@ async function initialize(
// Assets are processed directly by the builder except when watching
const adjustedOptions = options.watch ? options : { ...options, assets: [] };
// TODO_WEBPACK_5: Investigate build/serve issues with the `license-webpack-plugin` package
if (adjustedOptions.extractLicenses && isWebpackFiveOrHigher()) {
adjustedOptions.extractLicenses = false;
context.logger.warn(
'Warning: License extraction is currently disabled when using Webpack 5. ' +
'This is temporary and will be corrected in a future update.',
);
}
const {
config,
projectRoot,

View File

@ -7,7 +7,7 @@
*/
import * as webpack from 'webpack';
import { WebpackConfigOptions } from '../../utils/build-options';
import { isWebpackFiveOrHigher, withWebpackFourOrFive } from '../../utils/webpack-version';
import { withWebpackFourOrFive } from '../../utils/webpack-version';
import { CommonJsUsageWarnPlugin } from '../plugins';
import { getSourceMapDevTool } from '../utils/helpers';
@ -38,13 +38,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
}));
}
// TODO_WEBPACK_5: Investigate build/serve issues with the `license-webpack-plugin` package
if (extractLicenses && isWebpackFiveOrHigher()) {
wco.logger.warn(
'Warning: License extraction is currently disabled when using Webpack 5. ' +
'This is temporary and will be corrected in a future update.',
);
} else if (extractLicenses) {
if (extractLicenses) {
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
extraPlugins.push(new LicenseWebpackPlugin({
stats: {