Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit ad2e99a

Browse files
committed
refactor: clean up
1 parent 67d274b commit ad2e99a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/resolve.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,16 @@ impl Resolver {
243243
if RE_REACT_URL.is_match(fixed_url.as_str()) {
244244
let caps = RE_REACT_URL.captures(fixed_url.as_str()).unwrap();
245245
let mut host = caps.get(1).map_or("", |m| m.as_str());
246-
let other_host = !host.starts_with("esm.sh/")
246+
let non_esm_sh_cdn = !host.starts_with("esm.sh/")
247247
&& !host.starts_with("cdn.esm.sh/")
248248
&& !host.starts_with("esm.x-static.io/");
249-
if other_host {
249+
if non_esm_sh_cdn {
250250
host = "esm.sh/"
251251
}
252252
let pkg = caps.get(2).map_or("", |m| m.as_str());
253253
let ver = caps.get(3).map_or("", |m| m.as_str());
254254
let path = caps.get(4).map_or("", |m| m.as_str());
255-
if other_host || ver != version {
255+
if non_esm_sh_cdn || ver != version {
256256
fixed_url = format!("https://{}react{}@{}{}", host, pkg, version, path);
257257
}
258258
}
@@ -411,7 +411,7 @@ impl Fold for AlephResolveFold {
411411
.specifiers
412412
.into_iter()
413413
.for_each(|specifier| match specifier {
414-
// import { useState, useEffect as useEffect_ } from "https://esm.sh/react"
414+
// import { default as React, useState } from "https://esm.sh/react"
415415
ImportSpecifier::Named(ImportNamedSpecifier {
416416
local, imported, ..
417417
}) => {

0 commit comments

Comments
 (0)