mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 12:57:47 +00:00
[fs-detectors] Exclude the middleware builder if it's a Next.js app (#8239)
This commit is contained in:
@@ -2281,6 +2281,31 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should not add middleware builder when building "nextjs"', async () => {
|
||||
const files = ['package.json', 'pages/index.ts', 'middleware.ts'];
|
||||
const pkg = {
|
||||
scripts: { build: 'next build' },
|
||||
dependencies: { next: '12.2.0' },
|
||||
};
|
||||
const projectSettings = {
|
||||
framework: null, // "Other" framework
|
||||
createdAt: Date.parse('2020-02-01'),
|
||||
};
|
||||
const { builders } = await detectBuilders(files, pkg, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders).toEqual([
|
||||
{
|
||||
use: '@vercel/next',
|
||||
src: 'package.json',
|
||||
config: {
|
||||
zeroConfig: true,
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
it('Test `detectRoutes`', async () => {
|
||||
|
||||
Reference in New Issue
Block a user