diff --git a/packages/nx-cloudflare-wrangler/src/executors/pages/deploy/executor.ts b/packages/nx-cloudflare-wrangler/src/executors/pages/deploy/executor.ts index 399a7d0..21124d2 100644 --- a/packages/nx-cloudflare-wrangler/src/executors/pages/deploy/executor.ts +++ b/packages/nx-cloudflare-wrangler/src/executors/pages/deploy/executor.ts @@ -2,11 +2,15 @@ import { ExecutorContext, joinPathFragments } from '@nrwl/devkit'; import { PagesDeployExecutorSchema } from './schema'; import { runWranglerCommandForProject } from '../../wrangler'; import { execSync } from 'child_process'; +import { resolve } from 'path'; export default async function deployExecutor( options: PagesDeployExecutorSchema, context: ExecutorContext ) { + if (options.dist) { + options.dist = resolve(process.cwd(), options.dist); + } const dist = joinPathFragments( process.cwd(), context.workspace.projects[context.projectName].targets.build.options diff --git a/packages/nx-cloudflare-wrangler/src/executors/pages/serve/executor.ts b/packages/nx-cloudflare-wrangler/src/executors/pages/serve/executor.ts index ffa2f6e..8cc4ddb 100644 --- a/packages/nx-cloudflare-wrangler/src/executors/pages/serve/executor.ts +++ b/packages/nx-cloudflare-wrangler/src/executors/pages/serve/executor.ts @@ -1,11 +1,15 @@ import { ExecutorContext, joinPathFragments } from '@nrwl/devkit'; import { PagesServeExecutorSchema } from './schema'; import { runWranglerCommandForProject } from '../../wrangler'; +import { resolve } from 'path'; export default async function deployExecutor( options: PagesServeExecutorSchema, context: ExecutorContext ) { + if (options.dist) { + options.dist = resolve(process.cwd(), options.dist); + } const dist = joinPathFragments( process.cwd(), context.workspace.projects[context.projectName].targets.build.options diff --git a/packages/nx-cloudflare-wrangler/src/executors/pages/serve/schema.d.ts b/packages/nx-cloudflare-wrangler/src/executors/pages/serve/schema.d.ts index 748ecaf..9cb9e8e 100644 --- a/packages/nx-cloudflare-wrangler/src/executors/pages/serve/schema.d.ts +++ b/packages/nx-cloudflare-wrangler/src/executors/pages/serve/schema.d.ts @@ -1 +1,3 @@ -export interface PagesServeExecutorSchema {} +export interface PagesServeExecutorSchema { + dist?: string; +}