Skip to content

Commit

Permalink
fix(nextjs): add next.config.ts as valid config file
Browse files Browse the repository at this point in the history
closed nrwl#28572
  • Loading branch information
irontitan76 committed Oct 23, 2024
1 parent 12cbfc3 commit 6a30fd5
Show file tree
Hide file tree
Showing 5 changed files with 20,585 additions and 23,425 deletions.
1 change: 1 addition & 0 deletions docs/generated/packages/next/documents/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The `@nx/next` plugin will create tasks for any project that has a Next.js confi
- `next.config.js`
- `next.config.cjs`
- `next.config.mjs`
- `next.config.ts`

### View Inferred Tasks

Expand Down
1 change: 1 addition & 0 deletions docs/shared/packages/next/plugin-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The `@nx/next` plugin will create tasks for any project that has a Next.js confi
- `next.config.js`
- `next.config.cjs`
- `next.config.mjs`
- `next.config.ts`

### View Inferred Tasks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ export function findNextConfigPath(
);
}

const candidates = ['next.config.js', 'next.config.cjs', 'next.config.mjs'];
const candidates = [
'next.config.js',
'next.config.cjs',
'next.config.mjs',
'next.config.ts',
];
for (const candidate of candidates) {
if (existsSync(join(dirname, candidate))) return candidate;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface NextPluginOptions {
serveStaticTargetName?: string;
}

const nextConfigBlob = '**/next.config.{js,cjs,mjs}';
const nextConfigBlob = '**/next.config.{js,cjs,mjs,ts}';

function readTargetsCache(
cachePath: string
Expand Down
Loading

0 comments on commit 6a30fd5

Please sign in to comment.