Skip to content

Commit c4ac0e0

Browse files
fix: better account for render tags when pruning CSS (#14456)
Fixes #14399 Add a mechanism to connect render tags to snippets to know where to walk when coming across render tags --------- Co-authored-by: Simon H <[email protected]> Co-authored-by: Simon Holthausen <[email protected]>
1 parent dcef8ff commit c4ac0e0

File tree

46 files changed

+493
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+493
-232
lines changed

.changeset/twelve-squids-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: better account for render tags when pruning CSS

packages/svelte/src/compiler/phases/1-parse/state/tag.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ function open(parser) {
314314
name
315315
},
316316
parameters: function_expression.params,
317-
body: create_fragment()
317+
body: create_fragment(),
318+
metadata: {
319+
sites: new Set()
320+
}
318321
});
319322
parser.stack.push(block);
320323
parser.fragments.push(block.body);
@@ -605,7 +608,8 @@ function special(parser) {
605608
metadata: {
606609
dynamic: false,
607610
args_with_call_expression: new Set(),
608-
path: []
611+
path: [],
612+
snippets: new Set()
609613
}
610614
});
611615
}

0 commit comments

Comments
 (0)