mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-19 16:43:34 -04:00
Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: Ifd490eba5797e7731950b5b76282f32bb61349ca
This commit is contained in:
@@ -32,7 +32,6 @@ import {
|
||||
linkCollection,
|
||||
componentCollection,
|
||||
preprocessExtend,
|
||||
preprocessNewExtend,
|
||||
processSystemApi,
|
||||
propCollection,
|
||||
isObservedClass,
|
||||
@@ -85,11 +84,11 @@ export default function processImport(node: ts.ImportDeclaration | ts.ImportEqua
|
||||
fileResolvePath = getFileResolvePath(fileResolvePath, pagesDir, filePath);
|
||||
}
|
||||
if (fs.existsSync(fileResolvePath) && fs.statSync(fileResolvePath).isFile()) {
|
||||
const content: string = preprocessNewExtend(preprocessExtend(processSystemApi(
|
||||
const content: string = preprocessExtend(processSystemApi(
|
||||
fs.readFileSync(fileResolvePath, { encoding: 'utf-8' }).replace(
|
||||
new RegExp('\\b' + STRUCT + '\\b.+\\{', 'g'), item => {
|
||||
return item.replace(new RegExp('\\b' + STRUCT + '\\b', 'g'), `${CLASS} `);
|
||||
}))));
|
||||
})), fileResolvePath, log);
|
||||
const sourceFile: ts.SourceFile = ts.createSourceFile(filePath, content,
|
||||
ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
||||
visitAllNode(sourceFile, defaultName, asName, pagesDir, log);
|
||||
|
||||
Reference in New Issue
Block a user