From 762eceaced3b84fba10e0463b3281083ee3f8324 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 14 Feb 2022 19:46:40 +0800 Subject: [PATCH] houhaoyu@huawei.com fix bug of extra type Signed-off-by: houhaoyu Change-Id: Id47c045b1208512ec15dbaddf3d922c9e6ea0299 --- compiler/server/build_pipe_server.js | 2 +- compiler/webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index a087c32..4d3e8a6 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -57,7 +57,7 @@ function handlePluginCompileComponent(jsonData) { const newSource = ts.factory.updateSourceFile(sourceNode, previewStatements); const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); const result = printer.printNode(ts.EmitHint.Unspecified, newSource, newSource); - receivedMsg.data.script = result; + receivedMsg.data.script = ts.transpileModule(result, {}).outputText; if (pluginSocket.readyState === WebSocket.OPEN){ responseToPlugin(receivedMsg); } diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index d9d0cd6..e7fd2e4 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -100,7 +100,7 @@ function initConfig(config) { path.join(projectPath, '../../../../../'), './node_modules', path.join(__dirname, 'node_modules'), - path.join(__dirname, '../../api/common') + path.join(__dirname, '../../api') ] }, stats: { preset: 'none' },