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

Commit b22a261

Browse files
author
ije
committed
fix: fix watch when srcDir is not '/'
1 parent ab74c29 commit b22a261

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

project.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,18 +457,18 @@ export class Project {
457457
}
458458

459459
private async _loadConfig() {
460-
const { ALEPH_IMPORT_MAP } = globalThis as any
461-
if (ALEPH_IMPORT_MAP) {
462-
const { imports } = ALEPH_IMPORT_MAP
463-
Object.assign(this.importMap, { imports: Object.assign({}, this.importMap.imports, imports) })
464-
}
465-
466460
const importMapFile = path.join(this.appRoot, 'import_map.json')
467461
if (existsFileSync(importMapFile)) {
468462
const { imports } = JSON.parse(await Deno.readTextFile(importMapFile))
469463
Object.assign(this.importMap, { imports: Object.assign({}, this.importMap.imports, imports) })
470464
}
471465

466+
const { ALEPH_IMPORT_MAP } = globalThis as any
467+
if (ALEPH_IMPORT_MAP) {
468+
const { imports } = ALEPH_IMPORT_MAP
469+
Object.assign(this.importMap, { imports: Object.assign({}, this.importMap.imports, imports) })
470+
}
471+
472472
const config: Record<string, any> = {}
473473
for (const name of Array.from(['aleph.config', 'config']).map(name => ['ts', 'js', 'mjs', 'json'].map(ext => `${name}.${ext}`)).flat()) {
474474
const p = path.join(this.appRoot, name)
@@ -687,7 +687,7 @@ export class Project {
687687
log.info('Start watching code changes...')
688688
for await (const event of w) {
689689
for (const p of event.paths) {
690-
const path = util.cleanPath(util.trimPrefix(p, this.appRoot))
690+
const path = util.cleanPath(util.trimPrefix(p, this.srcDir))
691691
// handle `api` dir remove directly
692692
const validated = (() => {
693693
// ignore `.aleph` and output directories

0 commit comments

Comments
 (0)