Skip to content

Commit d3b8502

Browse files
committed
Fix global css hot reload issue
1 parent d06aa75 commit d3b8502

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/odd-doors-tan.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/wasm": patch
3+
---
4+
5+
Fix globalCss hot reload issue

bindings/devup-ui-wasm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Output {
4949
code,
5050
map,
5151
css_file,
52-
updated_base_style,
52+
updated_base_style: updated_base_style || default_collected,
5353
css: {
5454
if !collected && !default_collected {
5555
None

libs/sheet/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl StyleSheet {
239239

240240
for map in self
241241
.properties
242-
.entry("".to_string())
242+
.entry(file.to_string())
243243
.or_default()
244244
.values_mut()
245245
{
@@ -259,11 +259,11 @@ impl StyleSheet {
259259
}
260260
if self
261261
.properties
262-
.get("")
262+
.get(file)
263263
.and_then(|v| if v.is_empty() { None } else { Some(()) })
264264
.is_none()
265265
{
266-
self.properties.remove("");
266+
self.properties.remove(file);
267267
}
268268
true
269269
}

0 commit comments

Comments
 (0)