'use strict';

var chunkAF3E2D32_cjs = require('./chunk-AF3E2D32.cjs');
var exists = require('@stryke/path/exists');
var joinPaths = require('@stryke/path/join-paths');
var resolve = require('@stryke/path/resolve');

async function resolvePath(context, file) {
  let path = file;
  if (exists.existsSync(path)) {
    return path;
  }
  path = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, file);
  if (exists.existsSync(path)) {
    return path;
  }
  path = joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.projectRoot, file);
  if (exists.existsSync(path)) {
    return path;
  }
  path = joinPaths.joinPaths(context.projectRoot, file);
  if (exists.existsSync(path)) {
    return path;
  }
  return resolve.resolvePackage(file, {
    paths: [
      context.workspaceConfig.workspaceRoot,
      joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.projectRoot)
    ]
  });
}
chunkAF3E2D32_cjs.__name(resolvePath, "resolvePath");

exports.resolvePath = resolvePath;
//# sourceMappingURL=chunk-LIVWVTFX.cjs.map
//# sourceMappingURL=chunk-LIVWVTFX.cjs.map