Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Don't show webpack version message in production server (vercel#25654)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
timneutkens and kodiakhq[bot] committed Jun 2, 2021
1 parent 7c2c292 commit 0b81ff4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/next/next-server/server/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Worker } from 'jest-worker'
import * as Log from '../../build/output/log'
import { CheckReasons, CheckResult } from './config-utils-worker'
import { install, shouldLoadWithWebpack5 } from './config-utils-worker'
import { PHASE_PRODUCTION_SERVER } from '../lib/constants'

export { install, shouldLoadWithWebpack5 }

Expand Down Expand Up @@ -36,11 +37,15 @@ export async function loadWebpackHook(phase: string, dir: string) {
)
try {
const result: CheckResult = await worker.shouldLoadWithWebpack5(phase, dir)
Log.info(
`Using webpack ${result.enabled ? '5' : '4'}. Reason: ${reasonMessage(
result.reason
)} https://nextjs.org/docs/messages/webpack5`
)
// Don't log which webpack version is being used when booting production server as it's not used after build
if (phase !== PHASE_PRODUCTION_SERVER) {
Log.info(
`Using webpack ${result.enabled ? '5' : '4'}. Reason: ${reasonMessage(
result.reason
)} https://nextjs.org/docs/messages/webpack5`
)
}

useWebpack5 = Boolean(result.enabled)
} catch {
// If this errors, it likely will do so again upon boot, so we just swallow
Expand Down

0 comments on commit 0b81ff4

Please sign in to comment.