Skip to content

Commit

Permalink
test(turbopack): remove escape hatches for custom turbopack bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Sep 21, 2023
1 parent a17c235 commit d64bc66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
1 change: 0 additions & 1 deletion packages/next/src/cli/next-dev.ts
Expand Up @@ -234,7 +234,6 @@ const nextDev: CliCommand = async (args) => {

if (process.env.TURBOPACK) {
await validateTurboNextConfig({
isCustomTurbopack: !!process.env.__INTERNAL_CUSTOM_TURBOPACK_BINDINGS,
...devServerOptions,
isDev: true,
})
Expand Down
27 changes: 6 additions & 21 deletions packages/next/src/lib/turbopack-warning.ts
Expand Up @@ -85,11 +85,9 @@ const prodSpecificTurboNextConfigOptions = [
// check for babelrc, swc plugins
export async function validateTurboNextConfig({
dir,
isCustomTurbopack,
isDev,
}: {
allowRetry?: boolean
isCustomTurbopack?: boolean
dir: string
port: number
hostname?: string
Expand Down Expand Up @@ -212,9 +210,7 @@ export async function validateTurboNextConfig({
if (!hasWarningOrError) {
thankYouMessage = chalk.dim(thankYouMessage)
}
if (!isCustomTurbopack) {
console.log(turbopackGradient + thankYouMessage)
}
console.log(turbopackGradient + thankYouMessage)

let feedbackMessage = `Learn more about Next.js v13 and Turbopack: ${chalk.underline(
'https://nextjs.link/with-turbopack'
Expand Down Expand Up @@ -252,7 +248,7 @@ export async function validateTurboNextConfig({
.join('')}`
}

if (unsupportedParts && !isCustomTurbopack) {
if (unsupportedParts) {
const pkgManager = getPkgManager(dir)

console.error(
Expand All @@ -269,23 +265,12 @@ If you cannot make the changes above, but still want to try out\nNext.js v13 wit
`
)

if (!isCustomTurbopack) {
console.warn(feedbackMessage)

process.exit(1)
} else {
console.warn('\n')
console.warn(
`${chalk.bold.yellow(
'Warning:'
)} Unsupported config found; but continuing with custom Turbopack binary.\n`
)
}
}
console.warn(feedbackMessage)

if (!isCustomTurbopack) {
console.log(feedbackMessage)
process.exit(1)
}

console.log(feedbackMessage)

return rawNextConfig
}

0 comments on commit d64bc66

Please sign in to comment.