support typescript config

This commit is contained in:
silverwind 2024-05-18 00:42:47 +02:00
parent cdf81b4f7e
commit ba179d8472
Signed by: silverwind
GPG Key ID: 2E62B41C93869443
2 changed files with 8 additions and 4 deletions

@ -57,10 +57,10 @@ export default {
The config file can be placed in these locations, relative to `package.json`:
- `updates.config.js`
- `updates.config.mjs`
- `.config/updates.js`
- `.config/updates.mjs`
- `updates.config.{js,ts,mjs,mts}`
- `.config/updates.{js,ts,mjs,mts}`
For typescript, your runtime needs to support it either natively or via a node loader.
### Config File Options

@ -749,9 +749,13 @@ async function main() {
try {
({default: config} = await Promise.any([
"updates.config.js",
"updates.config.ts",
"updates.config.mjs",
"updates.config.mts",
".config/updates.js",
".config/updates.ts",
".config/updates.mjs",
".config/updates.mts",
].map(str => import(join(projectDir, ...str.split("/"))))));
} catch {}