@@ -132,7 +132,7 @@ export class Bundler {
132
132
return this . #compiled. get ( mod . url ) !
133
133
}
134
134
135
- const jsFile = util . trimSuffix ( mod . jsFile , '.js' ) + '.client.js'
135
+ const jsFile = join ( this . #app . buildDir , mod . jsFile . slice ( 0 , - 3 ) + '.client.js' )
136
136
this . #compiled. set ( mod . url , jsFile )
137
137
138
138
if ( await existsFile ( jsFile ) ) {
@@ -163,8 +163,8 @@ export class Bundler {
163
163
for ( let index = 0 ; index < starExports . length ; index ++ ) {
164
164
const url = starExports [ index ]
165
165
const names = await this . #app. parseModuleExportNames ( url )
166
- code = code . replace ( `export * from "[${ url } ]:` , `export {${ names . filter ( name => name !== 'default' ) . join ( ',' ) } } from "` )
167
- code = code . replace ( `export const $$star_${ index } ` , `export const {${ names . filter ( name => name !== 'default' ) . join ( ',' ) } }` )
166
+ code = code . replaceAll ( `export * from "[${ url } ]:` , `export {${ names . filter ( name => name !== 'default' ) . join ( ',' ) } } from "` )
167
+ code = code . replaceAll ( `export const $$star_${ index } ` , `export const {${ names . filter ( name => name !== 'default' ) . join ( ',' ) } }` )
168
168
}
169
169
}
170
170
@@ -219,11 +219,12 @@ export class Bundler {
219
219
/** create bundle chunk. */
220
220
private async bundleChunk ( name : string , entry : string [ ] , external : string [ ] ) {
221
221
const entryCode = ( await Promise . all ( entry . map ( async ( url , i ) => {
222
+ const { buildDir } = this . #app
222
223
let mod = this . #app. getModule ( url )
223
224
if ( mod && mod . jsFile !== '' ) {
224
225
if ( external . length === 0 ) {
225
226
return [
226
- `import * as mod_${ i } from ${ JSON . stringify ( 'file://' + mod . jsFile ) } ` ,
227
+ `import * as mod_${ i } from ${ JSON . stringify ( 'file://' + join ( buildDir , mod . jsFile ) ) } ` ,
227
228
`__ALEPH.pack[${ JSON . stringify ( url ) } ] = mod_${ i } `
228
229
]
229
230
} else {
0 commit comments