diff --git a/crates/rolldown_common/src/file_emitter.rs b/crates/rolldown_common/src/file_emitter.rs index b77113e9522a..318137a385b3 100644 --- a/crates/rolldown_common/src/file_emitter.rs +++ b/crates/rolldown_common/src/file_emitter.rs @@ -66,6 +66,8 @@ impl FileEmitter { }) .as_bytes(), ) + // The reference id can be used for import.meta.ROLLUP_FILE_URL_referenceId and therefore needs to be a valid identifier. + .replace('-', "$") .into() }