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

Commit 9b031af

Browse files
committed
Fix build command
1 parent 96b9a82 commit 9b031af

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

server/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export async function build(
124124
jsxFragment: jsxCofig.jsxRuntime === "preact" ? "Fragment" : "React.Fragment",
125125
inject: [jsxShimFile as string].filter(Boolean),
126126
plugins: [{
127-
name: "aleph-server-build-plugin",
127+
name: "aleph-esbuild-plugin",
128128
setup(build) {
129129
build.onResolve({ filter: /.*/ }, (args) => {
130130
let importUrl = args.path;

server/serve_modules.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,19 @@ const esModuleLoader = async (input: { pathname: string } & ModuleLoaderContent,
6262
}
6363
const deps = await parseDeps(specifier, rawCode, { importMap: JSON.stringify(env.importMap) });
6464
serverDependencyGraph.mark(specifier, { deps, inlineCSS });
65-
const locDeps = deps.filter((dep) => !util.isLikelyHttpURL(dep.specifier));
66-
if (locDeps.length) {
65+
if (deps.length) {
6766
const s = new MagicString(rawCode);
68-
locDeps.forEach((dep) => {
67+
deps.forEach((dep) => {
6968
const { specifier, importUrl, loc } = dep;
7069
if (loc) {
71-
const versionStr = serverDependencyGraph.get(specifier)?.version || serverDependencyGraph.initialVersion;
72-
let url = importUrl;
73-
if (url.includes("?")) {
74-
url = `"${url}&v=${versionStr}"`;
75-
} else {
76-
url = `"${url}?v=${versionStr}"`;
70+
let url = `"${importUrl}"`;
71+
if (!util.isLikelyHttpURL(specifier)) {
72+
const versionStr = serverDependencyGraph.get(specifier)?.version || serverDependencyGraph.initialVersion;
73+
if (importUrl.includes("?")) {
74+
url = `"${importUrl}&v=${versionStr}"`;
75+
} else {
76+
url = `"${importUrl}?v=${versionStr}"`;
77+
}
7778
}
7879
s.overwrite(loc.start, loc.end, url);
7980
}

0 commit comments

Comments
 (0)