Skip to content

Commit

Permalink
feat: support css module type in dataurl. (#2272)
Browse files Browse the repository at this point in the history
Due to the absence of bundle CSS support, the availability of ESbuild
tests remains undefined.

Let’s remove the unused functionality in `base64.rs`.
  • Loading branch information
7086cmd authored Sep 22, 2024
1 parent c174942 commit 00e6edd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions crates/rolldown_plugin_data_url/src/data_url_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl Plugin for DataUrlPlugin {
let module_type = match parsed.mime {
"text/javascript" => ModuleType::Js,
"application/json" => ModuleType::Json,
"text/css" => ModuleType::Css,
_ => {
return Ok(None);
}
Expand Down
4 changes: 0 additions & 4 deletions crates/rolldown_utils/src/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ pub fn to_url_safe_base64(input: impl AsRef<[u8]>) -> String {
pub fn to_standard_base64(input: impl AsRef<[u8]>) -> String {
base64_simd::STANDARD.encode_to_string(input)
}

pub fn from_standard_base64(input: impl AsRef<[u8]>) -> anyhow::Result<Vec<u8>> {
Ok(base64_simd::STANDARD.decode_to_vec(input)?)
}

0 comments on commit 00e6edd

Please sign in to comment.