mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 22:34:21 +08:00
refactor(@angular-devkit/build-angular): fully temporarily disable Webpack 5 license extraction
This commit is contained in:
parent
2fa17219d1
commit
a4d31fd16e
@ -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,
|
||||
|
@ -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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user