mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-18 16:04:32 -04:00
@@ -144,7 +144,7 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
} else if (/^@(system|ohos)/i.test(moduleName.trim())) {
|
||||
} else if (/^@(system|ohos)\./i.test(moduleName.trim())) {
|
||||
const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts');
|
||||
if (systemModules.includes(moduleName + '.d.ts') && ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.d.ts'));
|
||||
@@ -169,10 +169,14 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R
|
||||
const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts');
|
||||
const suffix: string = /\.js$/.test(moduleName) ? '' : '.js';
|
||||
const jsModulePath: string = path.resolve(__dirname, '../node_modules', moduleName + suffix);
|
||||
const fileModulePath: string =
|
||||
path.resolve(__dirname, '../node_modules', moduleName + '/index.js');
|
||||
if (ts.sys.fileExists(modulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.d.ts'));
|
||||
} else if (ts.sys.fileExists(jsModulePath)) {
|
||||
resolvedModules.push(getResolveModule(modulePath, '.js'));
|
||||
resolvedModules.push(getResolveModule(jsModulePath, '.js'));
|
||||
} else if (ts.sys.fileExists(fileModulePath)) {
|
||||
resolvedModules.push(getResolveModule(fileModulePath, '.js'));
|
||||
} else {
|
||||
resolvedModules.push(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user