diff --git a/.changeset/curly-ladybugs-happen.md b/.changeset/curly-ladybugs-happen.md new file mode 100644 index 0000000000..eb9e799b9e --- /dev/null +++ b/.changeset/curly-ladybugs-happen.md @@ -0,0 +1,5 @@ +--- +"@inlang/paraglide-next": patch +--- + +allow for next.config.ts in paraglide cli init command https://github.com/opral/monorepo/pull/3199 diff --git a/inlang/source-code/paraglide/paraglide-next/src/cli/flows/scan-next-project/index.ts b/inlang/source-code/paraglide/paraglide-next/src/cli/flows/scan-next-project/index.ts index 1a2cc44513..cd8511dcbf 100644 --- a/inlang/source-code/paraglide/paraglide-next/src/cli/flows/scan-next-project/index.ts +++ b/inlang/source-code/paraglide/paraglide-next/src/cli/flows/scan-next-project/index.ts @@ -99,13 +99,13 @@ export const scanNextJSProject: CliStep< } /** - * Attempts to find the next.config.js or next.config.mjs file in the current working directory. + * Attempts to find the next.config.js, next.config.mjs or next.config.ts file in the current working directory. */ async function findNextConfig( fs: NodeishFilesystem, cwd: string ): Promise { - const possibleNextConfigPaths = ["./next.config.js", "./next.config.mjs"].map( + const possibleNextConfigPaths = ["./next.config.js", "./next.config.mjs", "./next.config.ts"].map( (possibleRelativePath) => path.resolve(cwd, possibleRelativePath) ) @@ -113,7 +113,7 @@ async function findNextConfig( if (await fileExists(fs, possibleNextConfigPath)) { return { path: possibleNextConfigPath, - type: possibleNextConfigPath.endsWith(".mjs") ? "esm" : "cjs", + type: possibleNextConfigPath.endsWith(".js") ? "cjs" : "esm", } } }