diff --git a/packages/kbn-build/dist/cli.js b/packages/kbn-build/dist/cli.js index d9eca3c29ba6..eef33d9eea92 100644 --- a/packages/kbn-build/dist/cli.js +++ b/packages/kbn-build/dist/cli.js @@ -23514,7 +23514,7 @@ class Project { } ensureValidProjectDependency(project) { - const relativePathToProject = _path2.default.relative(this.path, project.path); + const relativePathToProject = normalizePath(_path2.default.relative(this.path, project.path)); const versionInPackageJson = this.allDependencies[project.name]; const expectedVersionInPackageJson = `${PREFIX}${relativePathToProject}`; @@ -23554,7 +23554,12 @@ class Project { return (0, _scripts.installInDir)(this.path, extraArgs); } } -exports.Project = Project; + +exports.Project = Project; // We normalize all path separators to `/` in generated files + +function normalizePath(path) { + return path.replace(/[\\\/]+/g, '/'); +} /***/ }), /* 175 */ diff --git a/packages/kbn-build/src/utils/project.js b/packages/kbn-build/src/utils/project.js index 334ac9749feb..b42dc6b597c8 100644 --- a/packages/kbn-build/src/utils/project.js +++ b/packages/kbn-build/src/utils/project.js @@ -34,7 +34,7 @@ export class Project { } ensureValidProjectDependency(project) { - const relativePathToProject = path.relative(this.path, project.path); + const relativePathToProject = normalizePath(path.relative(this.path, project.path)); const versionInPackageJson = this.allDependencies[project.name]; const expectedVersionInPackageJson = `${PREFIX}${relativePathToProject}`; @@ -88,3 +88,8 @@ export class Project { return installInDir(this.path, extraArgs); } } + +// We normalize all path separators to `/` in generated files +function normalizePath(path) { + return path.replace(/[\\\/]+/g, '/'); +}