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

Commit e9d310b

Browse files
committed
Fix build
1 parent c9daec6 commit e9d310b

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

server/build.ts

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ export async function build(
101101

102102
const forceBundle = (importUrl: string) => {
103103
return importUrl === alephPkgUri + "/server/mod.ts" ||
104+
importUrl === alephPkgUri + "/server/transformer.ts" ||
104105
// since deno deploy doesn't support importMap, we need to resolve the 'react' import
105106
importUrl.startsWith(alephPkgUri + "/framework/react/") ||
106-
importUrl.startsWith(`http://localhost:${Deno.env.get("ALEPH_APP_MODULES_PORT")}/`) ||
107-
importUrl.endsWith(".css");
107+
importUrl.startsWith(`http://localhost:${Deno.env.get("ALEPH_APP_MODULES_PORT")}/`);
108108
};
109109

110110
// build server entry
@@ -165,30 +165,26 @@ export async function build(
165165
}
166166
const res = await cache(url.href);
167167
const contents = await res.text();
168-
const ext = extname(url.pathname).slice(1);
169-
let loader = ext;
168+
let ext = extname(url.pathname).slice(1);
170169
if (ext === "mjs") {
171-
loader = "js";
170+
ext = "js";
172171
} else if (ext === "mts") {
173-
loader = "ts";
174-
} else if (ext === "pcss" || ext === "postcss") {
175-
loader = "css";
176-
}
177-
const ctype = res.headers.get("Content-Type");
178-
if (ctype?.startsWith("application/javascript")) {
179-
loader = "js";
180-
} else if (ctype?.startsWith("application/typescript")) {
181-
loader = "ts";
182-
} else if (ctype?.startsWith("text/jsx")) {
183-
loader = "jsx";
184-
} else if (ctype?.startsWith("text/tsx")) {
185-
loader = "tsx";
186-
} else if (ctype?.startsWith("text/css")) {
187-
loader = "css";
172+
ext = "ts";
173+
} else if (!builtinModuleExts.includes(ext)) {
174+
const ctype = res.headers.get("Content-Type");
175+
if (ctype?.startsWith("application/javascript")) {
176+
ext = "js";
177+
} else if (ctype?.startsWith("application/typescript")) {
178+
ext = "ts";
179+
} else if (ctype?.startsWith("text/jsx")) {
180+
ext = "jsx";
181+
} else if (ctype?.startsWith("text/tsx")) {
182+
ext = "tsx";
183+
}
188184
}
189185
return {
190186
contents,
191-
loader: loader as unknown as Loader,
187+
loader: ext as unknown as Loader,
192188
};
193189
});
194190
},
@@ -219,6 +215,7 @@ export async function build(
219215
}
220216
}
221217
}
218+
tasks.push(`${alephPkgUri}/framework/core/style.ts`);
222219

223220
// transform client modules
224221
const serverHandler: FetchHandler | undefined = Reflect.get(globalThis, "__ALEPH_SERVER_HANDLER");

0 commit comments

Comments
 (0)