mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +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,
|
getIndexInputFile,
|
||||||
getIndexOutputFile,
|
getIndexOutputFile,
|
||||||
} from '../utils/webpack-browser-config';
|
} from '../utils/webpack-browser-config';
|
||||||
|
import { isWebpackFiveOrHigher } from '../utils/webpack-version';
|
||||||
import {
|
import {
|
||||||
getAotConfig,
|
getAotConfig,
|
||||||
getBrowserConfig,
|
getBrowserConfig,
|
||||||
@ -176,6 +177,15 @@ async function initialize(
|
|||||||
// Assets are processed directly by the builder except when watching
|
// Assets are processed directly by the builder except when watching
|
||||||
const adjustedOptions = options.watch ? options : { ...options, assets: [] };
|
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 {
|
const {
|
||||||
config,
|
config,
|
||||||
projectRoot,
|
projectRoot,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
import * as webpack from 'webpack';
|
import * as webpack from 'webpack';
|
||||||
import { WebpackConfigOptions } from '../../utils/build-options';
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
||||||
import { isWebpackFiveOrHigher, withWebpackFourOrFive } from '../../utils/webpack-version';
|
import { withWebpackFourOrFive } from '../../utils/webpack-version';
|
||||||
import { CommonJsUsageWarnPlugin } from '../plugins';
|
import { CommonJsUsageWarnPlugin } from '../plugins';
|
||||||
import { getSourceMapDevTool } from '../utils/helpers';
|
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) {
|
||||||
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) {
|
|
||||||
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
|
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
|
||||||
extraPlugins.push(new LicenseWebpackPlugin({
|
extraPlugins.push(new LicenseWebpackPlugin({
|
||||||
stats: {
|
stats: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user