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' },