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

Commit db1cd35

Browse files
refactor: move preloading of library files to project.ts
1 parent f94257c commit db1cd35

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

html.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function createHtml({
3535
}
3636
return "";
3737
}))
38-
.concat(
38+
/*.concat(
3939
[
4040
"/_aleph/-/deno.land/x/aleph/error.js",
4141
"/_aleph/-/deno.land/x/aleph/aleph.js",
@@ -44,7 +44,7 @@ export function createHtml({
4444
].map((v) =>
4545
`<link rel="modulepreload" href=${JSON.stringify(v)} as="script" />`
4646
),
47-
)
47+
)*/
4848
.filter(Boolean);
4949
const scriptTags = scripts.map((v) => {
5050
if (util.isString(v)) {

project.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ export class Project {
276276
data ? { type: 'application/json', innerText: JSON.stringify(data), id: 'ssr-data' } : '',
277277
{ src: util.cleanPath(`${baseUrl}/_aleph/main.${mainModule.hash.slice(0, hashShort)}.js`), type: 'module' },
278278
{ src: util.cleanPath(`${baseUrl}/_aleph/-/deno.land/x/aleph/nomodule.js${this.isDev ? '?dev' : ''}`), nomodule: true },
279+
{ src: util.cleanPath(`${baseUrl}/_aleph/-/deno.land/x/aleph/error.js`), type: 'module', preload: true },
280+
{ src: util.cleanPath(`${baseUrl}/_aleph/-/deno.land/x/aleph/aleph.js`), type: 'module', preload: true },
281+
{ src: util.cleanPath(`${baseUrl}/_aleph/-/deno.land/x/aleph/context.js`), type: 'module', preload: true },
282+
{ src: util.cleanPath(`${baseUrl}/_aleph/-/deno.land/x/aleph/events.js`), type: 'module', preload: true },
279283
...scripts
280284
],
281285
body,

0 commit comments

Comments
 (0)