Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
schoero opened this issue May 24, 2024 · 0 comments
Open

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

schoero opened this issue May 24, 2024 · 0 comments

Comments

@schoero
Copy link

schoero commented May 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant