We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7e56c6 commit 84df719Copy full SHA for 84df719
turbopack/crates/turbopack-core/src/resolve/pattern.rs
@@ -378,6 +378,14 @@ impl Pattern {
378
379
/// Appends something to end the pattern.
380
pub fn push(&mut self, pat: Pattern) {
381
+ if let Pattern::Constant(this) = &*self
382
+ && this.is_empty()
383
+ {
384
+ // Short-circuit to replace empty constants with the appended pattern
385
+ *self = pat;
386
+ return;
387
+ }
388
+
389
match (self, pat) {
390
(Pattern::Concatenation(list), Pattern::Concatenation(more)) => {
391
concatenation_extend_or_merge_items(list, more.into_iter());
0 commit comments