diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 275a77b..1d13c0a 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -40,7 +40,7 @@ const pluginCommandChannelMessageHandlers = { 'compileComponent': handlePluginCompileComponent, 'default': () => {} }; -const es2abcFilePath = path.join(__dirname, '../bin/ark/build-win/bin/es2abc'); +let es2abcFilePath = path.join(__dirname, '../bin/ark/build-win/bin/es2abc'); let previewCacheFilePath; const messages = []; @@ -137,6 +137,11 @@ function handlePluginCompileComponent(jsonData) { receivedMsg.data.log = log; if (fs.existsSync(es2abcFilePath + '.exe') || fs.existsSync(es2abcFilePath)){ es2abc(receivedMsg); + } else { + es2abcFilePath = path.join(__dirname, '../bin/ark/build-mac/bin/es2abc'); + if (fs.existsSync(es2abcFilePath)) { + es2abc(receivedMsg); + } } }