Skip to content

Add support for custom import resolvers in synchronous bundle API #747

@schoero

Description

@schoero

Would it be possible to add custom import resolvers for the synchronous bundle() API?

Background:
I have created an ESLint Plugin that auto-fixes tailwindcss classes with the goal to make them more readable. Now I want to support tailwindcss 4 and its css based configuration.

ESLint does not support async rules, so I need a way to load the css config synchronously. Since tailwindcss 4 will also shift to lightningcss, I would also like to use lightningcss for that.

Based on the tailwindcss 4 announcement blog post, the import of the tailwindcss utilities will look like this:

@import "tailwindcss";

The import specifier tailwindcss cannot be resolved directly because it is not located in the same directory as the user config. Therefore, I need a way to implement the node module resolution algorithm.

While the asynchronous bundleAsync() function supports this via the resolver property, the synchronous bundle() function currently lacks this capability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions