Remove empty config warning (#49435)

## What?

Removes the empty `next.config.js` warning. Given that `create-next-app` now ships with an empty config with the type definition comment the warning is no longer needed.

## How?

Removed the warning, removed the tests.

Fixes NEXT-1107
This commit is contained in:
Tim Neutkens 2023-05-08 10:58:14 +02:00 committed by GitHub
parent 7e02f11e3a
commit e15741daca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 55 deletions

View file

@ -779,12 +779,6 @@ export default async function loadConfig(
}
}
if (Object.keys(userConfig).length === 0) {
curLog.warn(
`Detected ${configFileName}, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration`
)
}
if (userConfig.target && userConfig.target !== 'server') {
throw new Error(
`The "target" property is no longer supported in ${configFileName}.\n` +

View file

@ -1,6 +0,0 @@
/* eslint-disable */
{
experimental: {
basePath: '/docs'
}
}

View file

@ -1 +0,0 @@
export default () => <div>Hello World</div>

View file

@ -1,42 +0,0 @@
/* eslint-env jest */
import { join } from 'path'
import {
nextBuild,
launchApp,
findPort,
killApp,
waitFor,
} from 'next-test-utils'
const appDir = join(__dirname, '..')
describe('Empty configuration', () => {
it('should show relevant warning and compile successfully for next build', async () => {
const { stderr, stdout } = await nextBuild(appDir, [], {
stderr: true,
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\//
)
})
it('should show relevant warning and compile successfully for next dev', async () => {
let stderr = ''
const appPort = await findPort()
const app = await launchApp(appDir, appPort, {
onStderr(msg) {
stderr += msg || ''
},
})
await waitFor(1000)
await killApp(app)
expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\//
)
})
})