Skip to content

Commit d10281e

Browse files
authored
Additional files docs with legacyDevProcessCwdBehaviour (#2543)
1 parent 6798d57 commit d10281e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

docs/config/extensions/additionalFiles.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import { additionalFiles } from "@trigger.dev/build/extensions/core";
1313
export default defineConfig({
1414
project: "<project ref>",
1515
// Your other config settings...
16+
// We strongly recommend setting this to false
17+
// When set to `false`, the current working directory will be set to the build directory, which more closely matches production behavior.
18+
legacyDevProcessCwdBehaviour: false, // Default: true
1619
build: {
17-
extensions: [
18-
additionalFiles({ files: ["wrangler/wrangler.toml", "./assets/**", "./fonts/**"] }),
19-
],
20+
extensions: [additionalFiles({ files: ["./assets/**", "wrangler/wrangler.toml"] })],
2021
},
2122
});
2223
```
@@ -25,4 +26,13 @@ This will copy the files specified in the `files` array to the build directory.
2526

2627
This extension effects both the `dev` and the `deploy` commands, and the resulting paths will be the same for both.
2728

29+
If you use `legacyDevProcessCwdBehaviour: false`, you can then do this:
30+
31+
```ts
32+
import path from "node:path";
33+
34+
// You can use `process.cwd()` if you use `legacyDevProcessCwdBehaviour: false`
35+
const interRegularFont = path.join(process.cwd(), "assets/Inter-Regular.ttf");
36+
```
37+
2838
<Note>The root of the project is the directory that contains the trigger.config.ts file</Note>

0 commit comments

Comments
 (0)