From ba179d847253babe5908e666454c1149309b6704 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 18 May 2024 00:42:47 +0200 Subject: [PATCH] support typescript config --- README.md | 8 ++++---- updates.js | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 600dd0b..6252295 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/updates.js b/updates.js index 948b06c..37285e5 100755 --- a/updates.js +++ b/updates.js @@ -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 {}