Unverified Commit 3129db08 authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

[turbopack] Allow withRspack to work even if you already have NEXT_RSPACK set (#84987)

Fix an issue where if a user set `NEXT_RSPACK` as an environment variable then `next` would think it was using rspack but `withRspack` would think it was using `--webpack`.   The issue is that the idempotency check was too strict.

This partially reverts https://github.com/vercel/next.js/pull/84885
parent c27ac0dd
Error.stackTraceLimit = 100
module.exports = function withRspack(config) {
if (process.env.NEXT_RSPACK === 'true') {
if (process.env.NEXT_RSPACK) {
// we have already been called. This can happen when using build workers.
return config
}
if (!process.env.TURBOPACK || process.env.TURBOPACK === 'auto') {
if (process.env.TURBOPACK === 'auto') {
delete process.env.TURBOPACK
process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'
process.env.NEXT_RSPACK = 'true'
......
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