-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Adds support for tailwind.config.cjs files
#3181
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3181 +/- ##
==========================================
+ Coverage 93.28% 93.33% +0.05%
==========================================
Files 178 178
Lines 1831 1846 +15
Branches 323 328 +5
==========================================
+ Hits 1708 1723 +15
Misses 105 105
Partials 18 18
Continue to review full report at Codecov.
|
|
This will also likely need a small note added to the docs and support in |
4d1ed81 to
80b393b
Compare
|
Thanks! |
* feat: automatically init and resolve tailwind.config.cjs files * test: add tests for default tailwind.config.cjs resolution * fix `cjsConfigFile` constant * Fix JSDoc type of isModule
This PR adds default resolution and
npx tailwind initsupport fortailwind.config.cjsfiles.Currently, users who rely on Node ESM with
"type": "module"(officially supported since[email protected]) must manuallyrequireand pass their Tailwind config file to Tailwind.Implementing true
esm-compliant config files would likely be a large undertaking (requested in #2284), but this PR is a fairly simple stop-gap. With these changes, ESM users will now have the exact same DX as CJS users.Changes
tailwind.config.cjsfile if one existsnpx tailwind initwill automatically generate atailwind.config.cjsfile when run inside of a project with"type": "module"inpackage.jsonnpx tailwind init -pwill generate atailwind.config.cjsfile and apostcss.config.cjsfile when run inside of a project with"type": "module"inpackage.json