Skip to content

[babel-plugin] Module resolution Yarn PnP support #1282

@suhdonghwi

Description

@suhdonghwi

Describe the feature request

Hello. First of all, thank you for the great library!

Currently @stylexjs/babel-plugin uses @dual-bundle/import-meta-resolve (a fork of import-meta-resolve) to resolve module paths (code range).

However import-meta-resolve ponyfill does not support Yarn PnP environment. As a result, when using StyleX with Yarn PnP, it isn't possible to import styles from external packages.


As an alternative there is oxc-resolver, a port of webpack's enhanced-resolve. It implements the CJS/ESM resolution algorithms and supports Yarn PnP.

I'm currently maintaining a fork of the StyleX babel-plugin that uses oxc-resolver for module resolution instead of import-meta-resolve:

I've verified that it works in Yarn PnP mode and that all tests pass. Would you be open to accepting this change upstream? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions