mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 12:34:32 +08:00
refactor(@angular-devkit/build-angular): ignore postcss-loader warning
Users should not install `postcss` in their workspace as this is a dependency of `@angular-devkit/build-angular`.
This commit is contained in:
parent
7d57e5ae81
commit
cc4afa2de6
@ -44,7 +44,6 @@ import {
|
||||
getWatchOptions,
|
||||
normalizeExtraEntryPoints,
|
||||
} from '../utils/helpers';
|
||||
import { IGNORE_WARNINGS } from '../utils/stats';
|
||||
|
||||
// eslint-disable-next-line max-lines-per-function
|
||||
export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
|
||||
@ -430,7 +429,15 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
|
||||
performance: {
|
||||
hints: false,
|
||||
},
|
||||
ignoreWarnings: IGNORE_WARNINGS,
|
||||
ignoreWarnings: [
|
||||
// Webpack 5+ has no facility to disable this warning.
|
||||
// System.import is used in @angular/core for deprecated string-form lazy routes
|
||||
/System.import\(\) is deprecated and will be removed soon/i,
|
||||
// https://github.com/webpack-contrib/source-map-loader/blob/b2de4249c7431dd8432da607e08f0f65e9d64219/src/index.js#L83
|
||||
/Failed to parse source map from/,
|
||||
// https://github.com/webpack-contrib/postcss-loader/blob/bd261875fdf9c596af4ffb3a1a73fe3c549befda/src/index.js#L153-L158
|
||||
/Add postcss as project dependency/,
|
||||
],
|
||||
module: {
|
||||
// Show an error for missing exports instead of a warning.
|
||||
strictExportPresence: true,
|
||||
|
@ -240,14 +240,6 @@ function statsToString(
|
||||
}
|
||||
}
|
||||
|
||||
export const IGNORE_WARNINGS = [
|
||||
// Webpack 5+ has no facility to disable this warning.
|
||||
// System.import is used in @angular/core for deprecated string-form lazy routes
|
||||
/System.import\(\) is deprecated and will be removed soon/i,
|
||||
// https://github.com/webpack-contrib/source-map-loader/blob/b2de4249c7431dd8432da607e08f0f65e9d64219/src/index.js#L83
|
||||
/Failed to parse source map from/,
|
||||
];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function statsWarningsToString(json: StatsCompilation, statsConfig: any): string {
|
||||
const colors = statsConfig.colors;
|
||||
|
Loading…
x
Reference in New Issue
Block a user