Skip to content

user-defined aliases should take precedence over unenv polyfills #6448

@RamIdeas

Description

@RamIdeas

We recently introduced module aliasing in #6167

The experimental:nodejs_compat_v2 flag introduces unenv polyfills via an esbuild plugin onResolve hook. This plugin takes precedence over the user-defined aliases.

A simple repro can be found here https://github.com/RamIdeas/esbuild-alias-wrangler-repro/blob/main/build.mjs

I believe the solution is to reimplement the user-defined aliases via our own plugin which needs to be earlier in the plugin array. Creating this issue to track.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions