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 ESM build of the @tailwindcss/postcss package #13693

Merged
merged 2 commits into from
May 22, 2024

Conversation

wesbos
Copy link
Contributor

@wesbos wesbos commented May 16, 2024

This PR adds the ability to import the postcss plugin into esm files.

the package is currently published as CJS, but does not provide an export for ESM files to consume it. I ran into this when trying to use the postcss plugin inside my esm vite.config.ts file.

See: https://nodejs.org/api/packages.html#conditional-exports

"import" - matches when the package is loaded via import or import(), or via any top-level import or resolve operation by the ECMAScript module loader. Applies regardless of the module format of the target file.

@thecrypticace
Copy link
Contributor

heh I didn't do this because it broke nextjs. I wonder if that's fixed now…

@thecrypticace
Copy link
Contributor

looks like it is 💯 — i think we can actually ship a proper ESM build with this now too.

@wesbos
Copy link
Contributor Author

wesbos commented May 16, 2024

👌 Sweet, feel free to close this then

@thecrypticace thecrypticace changed the title Fixes exports when importing CJS form ESM file Add ESM build of the @tailwindcss/postcss package May 16, 2024
@RobinMalfait RobinMalfait merged commit 3116d65 into tailwindlabs:next May 22, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants