Skip to content

Commit 1df4002

Browse files
committed
fix(nx-payload): undefined paths do not need to be cleared during build
1 parent b28d725 commit 1df4002

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/nx-payload/src/executors/payload-build/payload-build.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ export async function payloadBuildExecutor(
1212
) {
1313
const normalizedOptions = normalizeOptions(options, context);
1414

15+
// Since build target depends on this target, we must start with a clean output
16+
const preCleanup = normalizedOptions.outputPath
17+
? [`rimraf ${normalizedOptions.outputPath} || true`]
18+
: [];
19+
1520
const output = await runCommandsImpl(
1621
{
1722
commands: [
18-
// Since build target depends on this target, we must start with a clean output
19-
`rimraf ${normalizedOptions.outputPath} || true`,
23+
...preCleanup,
2024
'npx payload build',
2125
'npx payload generate:types',
2226
'npx payload generate:graphQLSchema'

0 commit comments

Comments
 (0)