Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): suppress "@charset" must be the f…
Browse files Browse the repository at this point in the history
…irst rule in the file warning

esbuild will issue a warning when `@charset` is in the middle of the file. This is caused by css-loader will concats the file and doesn't hoist `@charset`, (webpack-contrib/css-loader#1212).

While, esbuild will issue a warning regarding the above, it will hoist to the very top.

In many cases, this warning is not actionable by the users as the `@charset` would be likely specified in 3rd party libs.

Closes #22097

(cherry picked from commit b3e5888)
  • Loading branch information
alan-agius4 authored and clydin committed Nov 8, 2021
1 parent 34047b1 commit 966a133
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ export async function getCommonConfig(
/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/,
// esbuild will issue a warning, while still hoists the @charset at the very top.
// This is caused by a bug in css-loader https://github.com/webpack-contrib/css-loader/issues/1212
/"@charset" must be the first rule in the file/,
],
module: {
// Show an error for missing exports instead of a warning.
Expand Down

0 comments on commit 966a133

Please sign in to comment.