@@ -260,16 +260,17 @@ export class Project {
260
260
return [ status , data ]
261
261
}
262
262
263
- getPreloadScripts ( baseUrl : string ) {
263
+ getPreloadScripts ( ) {
264
+ const { baseUrl } = this . config
264
265
const scripts = [
265
- '-/ deno.land/x/aleph/aleph.js' ,
266
- '-/ deno.land/x/aleph/context.js' ,
267
- '-/ deno.land/x/aleph/error.js' ,
268
- '-/ deno.land/x/aleph/events.js' ,
269
- '-/ deno.land/x/aleph/routing.js' ,
270
- '-/ deno.land/x/aleph/util.js'
266
+ 'deno.land/x/aleph/aleph.js' ,
267
+ 'deno.land/x/aleph/context.js' ,
268
+ 'deno.land/x/aleph/error.js' ,
269
+ 'deno.land/x/aleph/events.js' ,
270
+ 'deno.land/x/aleph/routing.js' ,
271
+ 'deno.land/x/aleph/util.js'
271
272
]
272
- return scripts . map ( src => ( { src : `${ baseUrl } ${ src } ` , type : 'module' , preload : true } ) )
273
+ return scripts . map ( src => ( { src : `${ baseUrl } _aleph/-/ ${ src } ` , type : 'module' , preload : true } ) )
273
274
}
274
275
275
276
async getPageHtml ( loc : { pathname : string , search ?: string } ) : Promise < [ number , string , Record < string , string > | null ] > {
@@ -287,7 +288,7 @@ export class Project {
287
288
scripts : [
288
289
data ? { type : 'application/json' , innerText : JSON . stringify ( data ) , id : 'ssr-data' } : '' ,
289
290
{ src : util . cleanPath ( `${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js` ) , type : 'module' } ,
290
- ...this . getPreloadScripts ( baseUrl ) ,
291
+ ...this . getPreloadScripts ( ) ,
291
292
...scripts
292
293
] ,
293
294
body,
@@ -305,7 +306,7 @@ export class Project {
305
306
scripts : [
306
307
{ src : util . cleanPath ( `${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js` ) , type : 'module' } ,
307
308
{ src : util . cleanPath ( `${ baseUrl } /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } ` ) , nomodule : true } ,
308
- ...this . getPreloadScripts ( baseUrl )
309
+ ...this . getPreloadScripts ( )
309
310
] ,
310
311
head : customLoading ?. head || [ ] ,
311
312
body : `<main>${ customLoading ?. body || '' } </main>` ,
@@ -392,7 +393,7 @@ export class Project {
392
393
data ? { type : 'application/json' , innerText : JSON . stringify ( data ) , id : 'ssr-data' } : '' ,
393
394
{ src : util . cleanPath ( `${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js` ) , type : 'module' } ,
394
395
{ src : util . cleanPath ( `${ baseUrl } /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } ` ) , nomodule : true } ,
395
- ...this . getPreloadScripts ( baseUrl ) ,
396
+ ...this . getPreloadScripts ( ) ,
396
397
...scripts
397
398
] ,
398
399
body,
0 commit comments