Unverified Commit d9b85667 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

remove unused preloadConfig flag (#68082)

Noticed this while looking at something else. This value is not used
anywhere and makes the existing code harder to read.
parent 48235e68
...@@ -4,7 +4,6 @@ import type { ...@@ -4,7 +4,6 @@ import type {
Options as ServerOptions, Options as ServerOptions,
} from './next-server' } from './next-server'
import type { UrlWithParsedQuery } from 'url' import type { UrlWithParsedQuery } from 'url'
import type { NextConfigComplete } from './config-shared'
import type { IncomingMessage, ServerResponse } from 'http' import type { IncomingMessage, ServerResponse } from 'http'
import type { NextUrlWithParsedQuery } from './request-meta' import type { NextUrlWithParsedQuery } from './request-meta'
import type { WorkerRequestHandler, WorkerUpgradeHandler } from './lib/types' import type { WorkerRequestHandler, WorkerUpgradeHandler } from './lib/types'
...@@ -41,10 +40,7 @@ export type NextServerOptions = Omit< ...@@ -41,10 +40,7 @@ export type NextServerOptions = Omit<
// This is assigned in this server abstraction. // This is assigned in this server abstraction.
'conf' 'conf'
> & > &
Partial<Pick<ServerOptions | DevServerOptions, 'conf'>> & { Partial<Pick<ServerOptions | DevServerOptions, 'conf'>>
preloadedConfig?: NextConfigComplete
internal_setStandaloneConfig?: boolean
}
export interface RequestHandler { export interface RequestHandler {
( (
...@@ -185,16 +181,14 @@ export class NextServer { ...@@ -185,16 +181,14 @@ export class NextServer {
private async [SYMBOL_LOAD_CONFIG]() { private async [SYMBOL_LOAD_CONFIG]() {
const dir = resolve(this.options.dir || '.') const dir = resolve(this.options.dir || '.')
const config = const config = await loadConfig(
this.options.preloadedConfig || this.options.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,
(await loadConfig( dir,
this.options.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER, {
dir, customConfig: this.options.conf,
{ silent: true,
customConfig: this.options.conf, }
silent: true, )
}
))
// check serialized build config when available // check serialized build config when available
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment