Skip to content

Commit

Permalink
remove unused preloadConfig flag (#68082)
Browse files Browse the repository at this point in the history
Noticed this while looking at something else. This value is not used
anywhere and makes the existing code harder to read.
  • Loading branch information
ztanner authored Jul 23, 2024
1 parent 48235e6 commit d9b8566
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions packages/next/src/server/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type {
Options as ServerOptions,
} from './next-server'
import type { UrlWithParsedQuery } from 'url'
import type { NextConfigComplete } from './config-shared'
import type { IncomingMessage, ServerResponse } from 'http'
import type { NextUrlWithParsedQuery } from './request-meta'
import type { WorkerRequestHandler, WorkerUpgradeHandler } from './lib/types'
Expand Down Expand Up @@ -41,10 +40,7 @@ export type NextServerOptions = Omit<
// This is assigned in this server abstraction.
'conf'
> &
Partial<Pick<ServerOptions | DevServerOptions, 'conf'>> & {
preloadedConfig?: NextConfigComplete
internal_setStandaloneConfig?: boolean
}
Partial<Pick<ServerOptions | DevServerOptions, 'conf'>>

export interface RequestHandler {
(
Expand Down Expand Up @@ -185,16 +181,14 @@ export class NextServer {
private async [SYMBOL_LOAD_CONFIG]() {
const dir = resolve(this.options.dir || '.')

const config =
this.options.preloadedConfig ||
(await loadConfig(
this.options.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,
dir,
{
customConfig: this.options.conf,
silent: true,
}
))
const config = await loadConfig(
this.options.dev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_SERVER,
dir,
{
customConfig: this.options.conf,
silent: true,
}
)

// check serialized build config when available
if (process.env.NODE_ENV === 'production') {
Expand Down

0 comments on commit d9b8566

Please sign in to comment.