mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-21 03:55:23 -04:00
houhaoyu@huawei.com support import dir Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: Ia8d1e3714d14e03c66d1985bee52ca3b74907397
This commit is contained in:
@@ -90,7 +90,13 @@ isEntryPage: boolean = true, pathCollection: Set<string> = new Set()): void {
|
||||
}
|
||||
}
|
||||
if (filePath && path.extname(filePath) !== EXTNAME_ETS && !isModule(filePath) && !isOhmUrl(filePath)) {
|
||||
filePath += EXTNAME_ETS;
|
||||
const dirIndexPath: string = path.resolve(path.resolve(pagesDir, filePath), INDEX_ETS);
|
||||
if (/^(\.|\.\.)\//.test(filePath) && !fs.existsSync(path.resolve(pagesDir, filePath + EXTNAME_ETS)) &&
|
||||
fs.existsSync(dirIndexPath)) {
|
||||
filePath = dirIndexPath;
|
||||
} else {
|
||||
filePath += EXTNAME_ETS;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -99,7 +105,8 @@ isEntryPage: boolean = true, pathCollection: Set<string> = new Set()): void {
|
||||
fileResolvePath = resolveSourceFile(filePath);
|
||||
} else if (/^(\.|\.\.)\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) {
|
||||
fileResolvePath = path.resolve(pagesDir, filePath);
|
||||
} else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0) {
|
||||
} else if (/^\//.test(filePath) && filePath.indexOf(NODE_MODULES) < 0 ||
|
||||
fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
|
||||
fileResolvePath = filePath;
|
||||
} else {
|
||||
fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath, projectConfig.projectPath);
|
||||
|
||||
Reference in New Issue
Block a user