Skip to main content

Function: resolveWorkflowsPath()

resolveWorkflowsPath(input, cwd?): string

Defined in: src/workflow-bundle/resolve-workflows-path.ts:43

Resolve a workflowsPath to a real file or directory, so a wrong path fails at startup with the fix in the message instead of deep inside the bundler.

  • Relative paths resolve against cwd (default process.cwd()).
  • A missing extension is tried as .ts, .js, .mjs, .cjs, then as a directory index.*.
  • .ts and .js are swapped when only the other exists: a path written for development (src/workflows.ts) still works from dist/ and the reverse.
  • Bare package specifiers (@scope/workflows) are returned untouched; the SDK bundler resolves those itself.
  • Numeric ids (what a bundler such as webpack turns require.resolve into) are rejected.

Parameters​

input​

string

cwd?​

string = ...

Returns​

string