From bdda69187ad8da0e1cf3fe3990a2a7901ae44173 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Tue, 23 Sep 2025 14:14:58 +0100 Subject: [PATCH] Additional files docs with legacyDevProcessCwdBehaviour --- docs/config/extensions/additionalFiles.mdx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/config/extensions/additionalFiles.mdx b/docs/config/extensions/additionalFiles.mdx index 58677914d4..038bf185ab 100644 --- a/docs/config/extensions/additionalFiles.mdx +++ b/docs/config/extensions/additionalFiles.mdx @@ -13,10 +13,11 @@ import { additionalFiles } from "@trigger.dev/build/extensions/core"; export default defineConfig({ project: "", // Your other config settings... + // We strongly recommend setting this to false + // When set to `false`, the current working directory will be set to the build directory, which more closely matches production behavior. + legacyDevProcessCwdBehaviour: false, // Default: true build: { - extensions: [ - additionalFiles({ files: ["wrangler/wrangler.toml", "./assets/**", "./fonts/**"] }), - ], + extensions: [additionalFiles({ files: ["./assets/**", "wrangler/wrangler.toml"] })], }, }); ``` @@ -25,4 +26,13 @@ This will copy the files specified in the `files` array to the build directory. This extension effects both the `dev` and the `deploy` commands, and the resulting paths will be the same for both. +If you use `legacyDevProcessCwdBehaviour: false`, you can then do this: + +```ts +import path from "node:path"; + +// You can use `process.cwd()` if you use `legacyDevProcessCwdBehaviour: false` +const interRegularFont = path.join(process.cwd(), "assets/Inter-Regular.ttf"); +``` + The root of the project is the directory that contains the trigger.config.ts file