Skip to content

Commit 966a133

Browse files
alan-agius4clydin
authored andcommittedNov 8, 2021
fix(@angular-devkit/build-angular): suppress "@charset" must be the first 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)
1 parent 34047b1 commit 966a133

File tree

1 file changed

+3
-0
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+3
-0
lines changed
 

Diff for: ‎packages/angular_devkit/build_angular/src/webpack/configs/common.ts

+3
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ export async function getCommonConfig(
364364
/Failed to parse source map from/,
365365
// https://github.com/webpack-contrib/postcss-loader/blob/bd261875fdf9c596af4ffb3a1a73fe3c549befda/src/index.js#L153-L158
366366
/Add postcss as project dependency/,
367+
// esbuild will issue a warning, while still hoists the @charset at the very top.
368+
// This is caused by a bug in css-loader https://github.com/webpack-contrib/css-loader/issues/1212
369+
/"@charset" must be the first rule in the file/,
367370
],
368371
module: {
369372
// Show an error for missing exports instead of a warning.

0 commit comments

Comments
 (0)
Please sign in to comment.