next.js
ecf7126f - Store node_env in TransformContext instead of SwcEcmaTransformPluginsTransformer

Commit
2 days ago
Store node_env in TransformContext instead of SwcEcmaTransformPluginsTransformer The SWC plugin transformer was storing node_env as a field on the struct, which caused it to be locked in at plugin construction time from NextMode. Instead, derive node_env from process.env.NODE_ENV compile-time defines in EcmascriptModuleAsset::parse() and thread it through TransformContext so each file transformation sees the correct environment value. Co-Authored-By: Claude <noreply@anthropic.com>
Author
Parents
Loading