Skip to content

Commit 5ca68b4

Browse files
authored
fix(turbopack-css): ignore lightning-css global pseudo elements warning (#65)
* fix(css): ignore lightning-css global pseudo elements warning * chore: update review
1 parent 62c9270 commit 5ca68b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

turbopack/crates/turbopack-css/src/process.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,13 @@ async fn process_content(
468468
// `.await` in the loop.
469469
let warnings = warnings.read().unwrap().iter().cloned().collect::<Vec<_>>();
470470
for err in warnings.iter() {
471-
match err.kind {
471+
match &err.kind {
472+
// Ignore :global pseudo-class errors from preprocessors like LESS
473+
lightningcss::error::ParserError::SelectorError(
474+
lightningcss::error::SelectorError::UnsupportedPseudoClass(name),
475+
) if name.as_ref() == "global" => {
476+
continue;
477+
}
472478
lightningcss::error::ParserError::UnexpectedToken(_)
473479
| lightningcss::error::ParserError::UnexpectedImportRule
474480
| lightningcss::error::ParserError::SelectorError(..)
@@ -495,7 +501,7 @@ async fn process_content(
495501
}
496502

497503
_ => {
498-
// Ignore
504+
// Ignore other warnings
499505
}
500506
}
501507
}

0 commit comments

Comments
 (0)