Skip to content

Commit 6325e2e

Browse files
committed
Reword for clarity
1 parent 2d463c0 commit 6325e2e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

website/docs/tasks.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ the plugins you have loaded.
8989

9090
## Loading JavaScript files
9191

92-
With the default preset, Graphile Worker will look for files ending in `.js`,
93-
`.cjs`, `.mjs`, `.ts`, or `.mts` (in that order of priority) and attempt to load
94-
them as task executors using the `import()` function. If the file is a CommonJS
95-
module, then Worker will expect `module.exports` to be the task executor
96-
function; if the file is an ECMAScript module (ESM) then Worker will expect the
97-
default export to be the task executor function.
92+
With the default preset, Graphile Worker will group files in the `tasks` folder
93+
by basename; for each basename it will load via `import()` the first matching
94+
file, if any, with extension (in priority order) `.js`, `.cjs`, `.mjs`, `.ts`,
95+
or `.mts`. If the file is a CommonJS module, then Worker will expect
96+
`module.exports` to be the task executor function; if the file is an ECMAScript
97+
module (ESM) then Worker will expect the default export to be the task executor
98+
function.
9899

99100
You can add support for other ways of loading task executors via plugins; look
100101
at the source code of

0 commit comments

Comments
 (0)