Skip to content

Commit

Permalink
fix(nextjs): support config files with dots in filename (#17204)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored May 25, 2023
1 parent f8b4f91 commit 45a0171
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Next.js config: getWithNxContent', () => {
expect(modulePaths).toEqual([
'nested/a.cjs',
'nested/b.cjs',
'nested-c.cjs',
'nested.c.cjs',
]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ export function ensureFileExtensions(
): string[] {
const extensions = ['.js', '.cjs', '.mjs'];
return files.map((file) => {
if (extname(file)) return file;
const providedExt = extname(file);
if (providedExt && extensions.includes(providedExt)) return file;

const ext = extensions.find((ext) =>
existsSync(join(absoluteDir, file + ext))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require('./a'); // Circular dependency should be handled
require('../nested-c'); // one level up
require('../nested.c'); // one level up
module.exports = {};

1 comment on commit 45a0171

@vercel
Copy link

@vercel vercel bot commented on 45a0171 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.