Skip to content

Commit 7752238

Browse files
authored
fix: make sure asset reference id could be a valid identifier (rolldown#2198)
<!-- Thank you for contributing! --> ### Description <!-- Please insert your description here and provide especially info about the "what" this PR is solving --> close vitejs/rolldown-vite#27 (comment) ref https://github.com/rollup/rollup/blob/master/src/utils/FileEmitter.ts#L300
1 parent e36915a commit 7752238

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/rolldown_common/src/file_emitter.rs

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ impl FileEmitter {
6666
})
6767
.as_bytes(),
6868
)
69+
// The reference id can be used for import.meta.ROLLUP_FILE_URL_referenceId and therefore needs to be a valid identifier.
70+
.replace('-', "$")
6971
.into()
7072
}
7173

0 commit comments

Comments
 (0)