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

Commit 2a69225

Browse files
committed
Remove hash info of bundling url
1 parent 8699ed8 commit 2a69225

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

compiler/src/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl Resolver {
358358
filename.push_str("bundling.");
359359
}
360360
filename.push_str("js");
361-
if !is_remote && !self.specifier_is_remote {
361+
if !(self.bundle_mode && !is_dynamic) && !is_remote && !self.specifier_is_remote {
362362
filename.push_str("#");
363363
filename.push_str(fixed_url.as_str());
364364
filename.push_str("@000000");
@@ -376,7 +376,7 @@ impl Resolver {
376376
filename.push_str(".bundling");
377377
}
378378
filename.push_str(".js");
379-
if !is_remote && !self.specifier_is_remote {
379+
if !(self.bundle_mode && !is_dynamic) && !is_remote && !self.specifier_is_remote {
380380
filename.push('#');
381381
filename.push_str(fixed_url.as_str());
382382
filename.push_str("@000000");

compiler/src/resolve_fold.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ impl Fold for ResolveFold {
5353

5454
// resolve import/export url
5555
// [/pages/index.tsx]
56-
// - es6 mode:
56+
// - dev mode:
5757
// - `import React, { useState } from "https://esm.sh/react"` -> `import React, {useState} from "/-/esm.sh/react.js"`
5858
// - `import * as React from "https://esm.sh/react"` -> `import * as React from "/-/esm.sh/react.js"`
5959
// - `import Logo from "../components/logo.tsx"` -> `import Logo from "/components/logo.js"`
6060
// - `import "../style/index.css" -> `import "/style/index.css.js"`
6161
// - `export React, {useState} from "https://esm.sh/react"` -> `export React, {useState} from * from "/-/esm.sh/react.js"`
6262
// - `export * from "https://esm.sh/react"` -> `export * from "/-/esm.sh/react.js"`
63-
// - bundling mode:
63+
// - bundle mode:
6464
// - `import React, { useState } from "https://esm.sh/react"` -> `const { default: React, useState } = __ALEPH.pack["https://esm.sh/react"];`
6565
// - `import * as React from "https://esm.sh/react"` -> `const React = __ALEPH.pack["https://esm.sh/react"]`
6666
// - `import Logo from "../components/logo.tsx"` -> `const { default: Logo } = __ALEPH.pack["/components/logo.tsx"]`
@@ -736,11 +736,9 @@ mod tests {
736736
assert!(code.contains("const { default: React , useState , useEffect: useEffect_ } = __ALEPH.pack[\"https://esm.sh/react\"]"));
737737
assert!(code.contains("const React_ = __ALEPH.pack[\"https://esm.sh/react\"]"));
738738
assert!(code.contains("const { default: Logo } = __ALEPH.pack[\"/components/logo.tsx\"]"));
739-
assert!(
740-
code.contains("import Nav from \"../components/nav.bundling.js#/components/nav.tsx@000000\"")
741-
);
739+
assert!(code.contains("import Nav from \"../components/nav.bundling.js\""));
742740
assert!(!code.contains("__ALEPH.pack[\"/shared/iife.ts\"]"));
743-
assert!(code.contains("import \"../shared/iife2.bundling.js#/shared/iife2.ts@000000\""));
741+
assert!(code.contains("import \"../shared/iife2.bundling.js\""));
744742
assert!(
745743
code.contains("AsyncLogo = React.lazy(()=>__ALEPH.import(\"/components/async-logo.tsx\"")
746744
);
@@ -751,7 +749,7 @@ mod tests {
751749
"import __ALEPH_StyleLink from \"../-/deno.land/x/aleph/framework/react/components/StyleLink.bundling.js\""
752750
));
753751
assert!(code.contains("import \"../-/esm.sh/tailwindcss/dist/tailwind.min.css.bundling.js\""));
754-
assert!(code.contains("import \"../style/index.css.bundling.js#/style/index.css@000000\""));
752+
assert!(code.contains("import \"../style/index.css.bundling.js\""));
755753
assert!(code.contains("export const $$star_0 = __ALEPH.pack[\"https://esm.sh/react\"]"));
756754
assert!(code.contains("export const ReactDom = __ALEPH.pack[\"https://esm.sh/react-dom\"]"));
757755
assert!(code.contains("export const { render } = __ALEPH.pack[\"https://esm.sh/react-dom\"]"));

0 commit comments

Comments
 (0)