From 1d40f2204986fe0c623a0ce993c812d3c6b2add3 Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 15 Mar 2022 23:22:28 +0800 Subject: [PATCH] fixed 0d4d46d from https://gitee.com/lihong67/developtools_ace-ets2bundle/pulls/392 lihong67@huawei.com fix visual bug. Signed-off-by: lihong Change-Id: I07988c2e0c47ed88e66f4f974c0c32698be186fe --- compiler/src/pre_process.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index 5d501cabe..db8f5d894 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -74,8 +74,13 @@ function parseVisual(resourcePath: string, resourceQuery: string, content: strin } visualMap.clear(); slotMap.clear(); + const compilerOptions = ts.readConfigFile( + path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions; + Object.assign(compilerOptions, { + 'sourceMap': false + }); const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, - ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + ts.ScriptTarget.Latest, true, ts.ScriptKind.ETS, compilerOptions); let newContent: string = content; if (sourceFile.statements) { sourceFile.statements.forEach(statement => { @@ -95,7 +100,7 @@ function parseVisual(resourcePath: string, resourceQuery: string, content: strin function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], visualContent: any): string { - if (statement.kind === ts.SyntaxKind.ClassDeclaration && + if (statement.kind === ts.SyntaxKind.StructDeclaration && statement.name && statement.name.getText() === componentCollection.entryComponent) { if (statement.members) { statement.members.forEach(member => { -- Gitee