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

Commit 6538b73

Browse files
author
Je
committed
fix: fix local js import
1 parent 574f3af commit 6538b73

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

project.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default class Project {
159159
if (path) {
160160
const importPath = '.' + path + '.js'
161161
if (this.#modules.has(importPath)) {
162-
const { default: handle } = await import(this.#modules.get(importPath)!.jsFile)
162+
const { default: handle } = await import("file://" + this.#modules.get(importPath)!.jsFile)
163163
return handle
164164
}
165165
}
@@ -212,7 +212,7 @@ export default class Project {
212212
async getData() {
213213
const mod = this.#modules.get('./data.js') || this.#modules.get('./data/index.js')
214214
if (mod) {
215-
const { default: Data } = await import(mod.jsFile)
215+
const { default: Data } = await import("file://" + "file://" + mod.jsFile)
216216
let data: any = Data
217217
if (util.isFunction(Data)) {
218218
data = await Data()
@@ -325,7 +325,7 @@ export default class Project {
325325
log.fatal('parse config.json:', e.message)
326326
}
327327
} else {
328-
const { default: conf } = await import(p)
328+
const { default: conf } = await import("file://" + p)
329329
if (util.isPlainObject(conf)) {
330330
Object.assign(config, conf)
331331
log.debug(name, config)
@@ -1041,9 +1041,9 @@ export default class Project {
10411041
{ default: App },
10421042
{ default: Page }
10431043
] = await Promise.all([
1044-
import(this.#modules.get('//deno.land/x/aleph/renderer.js')!.jsFile),
1045-
appModule ? await import(appModule.jsFile) : Promise.resolve({}),
1046-
await import(pageModule.jsFile)
1044+
import("file://" + this.#modules.get('//deno.land/x/aleph/renderer.js')!.jsFile),
1045+
appModule ? await import("file://" + appModule.jsFile) : Promise.resolve({}),
1046+
await import("file://" + pageModule.jsFile)
10471047
])
10481048
const data = await this.getData()
10491049
const html = renderPage(data, url, appModule ? App : undefined, Page)

0 commit comments

Comments
 (0)