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

Commit 4730aca

Browse files
committed
Merge master
1 parent f697ddb commit 4730aca

File tree

8 files changed

+579
-484
lines changed

8 files changed

+579
-484
lines changed

bundler/mod.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class Bundler {
132132
return this.#compiled.get(mod.url)!
133133
}
134134

135-
const jsFile = util.trimSuffix(mod.jsFile, '.js') + '.client.js'
135+
const jsFile = join(this.#app.buildDir, mod.jsFile.slice(0, -3) + '.client.js')
136136
this.#compiled.set(mod.url, jsFile)
137137

138138
if (await existsFile(jsFile)) {
@@ -163,8 +163,8 @@ export class Bundler {
163163
for (let index = 0; index < starExports.length; index++) {
164164
const url = starExports[index]
165165
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(',')}}`)
168168
}
169169
}
170170

@@ -219,11 +219,12 @@ export class Bundler {
219219
/** create bundle chunk. */
220220
private async bundleChunk(name: string, entry: string[], external: string[]) {
221221
const entryCode = (await Promise.all(entry.map(async (url, i) => {
222+
const { buildDir } = this.#app
222223
let mod = this.#app.getModule(url)
223224
if (mod && mod.jsFile !== '') {
224225
if (external.length === 0) {
225226
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))}`,
227228
`__ALEPH.pack[${JSON.stringify(url)}] = mod_${i}`
228229
]
229230
} else {

0 commit comments

Comments
 (0)