From bf769503e315d9f0d9ee59047c51f3fddf48686b Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Wed, 23 May 2018 16:28:12 +0200 Subject: [PATCH] fix(ui): Windows compat --- packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js | 2 +- packages/@vue/cli-ui/src/graphql-api/utils/resolve-path.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js b/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js index adb2de1cb0..01e852c49c 100644 --- a/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js +++ b/packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js @@ -269,7 +269,7 @@ async function run (id, context) { const child = execa(command, args, { cwd: cwd.get(), - stdio: ['inherit', 'pipe', 'pipe', 'ipc'] + stdio: ['inherit', 'pipe', 'pipe'] }) task.child = child diff --git a/packages/@vue/cli-ui/src/graphql-api/utils/resolve-path.js b/packages/@vue/cli-ui/src/graphql-api/utils/resolve-path.js index d579d22aed..1adc719673 100644 --- a/packages/@vue/cli-ui/src/graphql-api/utils/resolve-path.js +++ b/packages/@vue/cli-ui/src/graphql-api/utils/resolve-path.js @@ -1,11 +1,14 @@ +const path = require('path') + exports.resolveModuleRoot = function (filePath, id = null) { { - const index = filePath.lastIndexOf('/index.js') + const index = filePath.lastIndexOf(path.sep + 'index.js') if (index !== -1) { filePath = filePath.substr(0, index) } } if (id) { + id = id.replace(/\//g, path.sep) const index = filePath.lastIndexOf(id) if (index !== -1) { filePath = filePath.substr(0, index + id.length)