@adamwathan Does Tailwind 4.x still support require()? I see it in the package exports field, but get an error when attempting to require @tailwindcss/postcss.
1
1
Yea, that's an ESM config file (.mjs). In this case, I'm integrating Tailwind with other tools that don't support module syntax yet, so looking to use require().
1
1
The syntax of the postcss config file doesn't matter. It'll load ESM postcss plugins just fine if you use module.exports = { … } instead (and make sure the config file is named right). *however*, yes the postcss plugin still supports CJS:
1
1
What error are you running into?
This. Latest node, all dependencies installed, CWD set appropriately. The require() fails. Unsure why yet.
1
1
Looks like it might be the explicit full path. If I provide just the package name, it suddenly works. Haven't seen that before (and I load *A LOT* of node packages in CodeKit, as you might imagine):

Jan 26, 2025 · 12:30 AM UTC

1
1
I think the full path will only work if there's an index.js file in the folder. It doesn't consult exports, or main or anything like that afaik. That might be why.