@@ -265,8 +265,8 @@ export class Project {
265
265
head : head ,
266
266
scripts : [
267
267
data ? { type : 'application/json' , innerText : JSON . stringify ( data ) , id : 'ssr-data' } : '' ,
268
- { src : path . join ( baseUrl , ` /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
269
- { src : path . join ( baseUrl , ` /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
268
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
269
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
270
270
...scripts
271
271
] ,
272
272
body,
@@ -283,8 +283,8 @@ export class Project {
283
283
lang : defaultLocale ,
284
284
scripts : [
285
285
customLoading ?. data ? { type : 'application/json' , innerText : JSON . stringify ( customLoading ?. data ) , id : 'ssr-data' } : '' ,
286
- { src : path . join ( baseUrl , ` /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
287
- { src : path . join ( baseUrl , ` /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
286
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
287
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
288
288
] ,
289
289
head : customLoading ?. head || [ ] ,
290
290
body : `<main>${ customLoading ?. body || '' } </main>` ,
@@ -369,8 +369,8 @@ export class Project {
369
369
head : head ,
370
370
scripts : [
371
371
data ? { type : 'application/json' , innerText : JSON . stringify ( data ) , id : 'ssr-data' } : '' ,
372
- { src : path . join ( baseUrl , ` /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
373
- { src : path . join ( baseUrl , ` /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
372
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/main.${ mainModule . hash . slice ( 0 , hashShort ) } .js`) , type : 'module' } ,
373
+ { src : util . cleanPath ( ` ${ baseUrl } /_aleph/-/deno.land/x/aleph/nomodule.js${ this . isDev ? '?dev' : '' } `) , nomodule : true } ,
374
374
...scripts
375
375
] ,
376
376
body,
@@ -382,13 +382,13 @@ export class Project {
382
382
const publicDir = path . join ( this . appRoot , 'public' )
383
383
if ( existsDirSync ( publicDir ) ) {
384
384
log . info ( colors . bold ( '- Public Assets' ) )
385
- for await ( const { path : p } of walk ( publicDir , { includeDirs : false , skip : [ / \/ \. [ ^ \/ ] + ( $ | \/ ) / ] } ) ) {
385
+ for await ( const { path : p } of walk ( publicDir , { includeDirs : false , skip : [ / \. D S _ S t o r e $ / ] } ) ) {
386
386
const rp = util . trimPrefix ( p , publicDir )
387
387
const fp = path . join ( outputDir , rp )
388
388
const fi = await Deno . lstat ( p )
389
389
await ensureDir ( path . dirname ( fp ) )
390
390
await Deno . copyFile ( p , fp )
391
- log . info ( ' ✹' , rp , colors . dim ( '•' ) , colorfulBytesString ( fi . size ) )
391
+ log . info ( ' ✹' , rp . split ( '\\' ) . join ( '/' ) , colors . dim ( '•' ) , colorfulBytesString ( fi . size ) )
392
392
}
393
393
}
394
394
@@ -595,13 +595,13 @@ export class Project {
595
595
596
596
if ( existsDirSync ( apiDir ) ) {
597
597
for await ( const { path : p } of walk ( apiDir , walkOptions ) ) {
598
- const mod = await this . _compile ( '/api' + util . trimPrefix ( p , apiDir ) )
598
+ const mod = await this . _compile ( '/api' + util . trimPrefix ( p , apiDir ) . split ( '\\' ) . join ( '/' ) )
599
599
this . #apiRouting. update ( this . _getRouteModule ( mod ) )
600
600
}
601
601
}
602
602
603
603
for await ( const { path : p } of walk ( pagesDir , { ...walkOptions , exts : [ ...walkOptions . exts , '.jsx' , '.tsx' , '.md' ] } ) ) {
604
- const rp = util . trimPrefix ( p , pagesDir )
604
+ const rp = util . trimPrefix ( p , pagesDir ) . split ( '\\' ) . join ( '/' )
605
605
const mod = await this . _compile ( '/pages' + rp )
606
606
this . #routing. update ( this . _getRouteModule ( mod ) )
607
607
}
@@ -1228,7 +1228,7 @@ export class Project {
1228
1228
const modUrl = new URL ( importer . url )
1229
1229
let pathname = url
1230
1230
if ( ! pathname . startsWith ( '/' ) ) {
1231
- pathname = path . join ( path . dirname ( modUrl . pathname ) , url )
1231
+ pathname = util . cleanPath ( path . dirname ( modUrl . pathname ) + '/' + url )
1232
1232
}
1233
1233
const importUrl = new URL ( modUrl . protocol + '//' + modUrl . host + pathname )
1234
1234
rewrittenURL = getRelativePath (
@@ -1248,7 +1248,7 @@ export class Project {
1248
1248
const sourceUrl = new URL ( importer . url )
1249
1249
let pathname = url
1250
1250
if ( ! pathname . startsWith ( '/' ) ) {
1251
- pathname = path . join ( path . dirname ( sourceUrl . pathname ) , url )
1251
+ pathname = util . cleanPath ( path . dirname ( sourceUrl . pathname ) + '/' + url )
1252
1252
}
1253
1253
importer . deps . push ( {
1254
1254
url : sourceUrl . protocol + '//' + sourceUrl . host + pathname ,
@@ -1258,7 +1258,7 @@ export class Project {
1258
1258
} )
1259
1259
} else {
1260
1260
importer . deps . push ( {
1261
- url : path . join ( path . dirname ( importer . url ) , url ) ,
1261
+ url : util . cleanPath ( path . dirname ( importer . url ) + '/' + url ) ,
1262
1262
hash : '' ,
1263
1263
async,
1264
1264
external : pluginsResolveRet ?. external
0 commit comments