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:
parent
7e02f11e3a
commit
e15741daca
4 changed files with 0 additions and 55 deletions
|
@ -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` +
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
/* eslint-disable */
|
||||
{
|
||||
experimental: {
|
||||
basePath: '/docs'
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
export default () => <div>Hello World</div>
|
|
@ -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:\/\//
|
||||
)
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue