-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[v4] Standalone cli doesn't bundle tailwindcss js library #15235
Comments
This problem still exists on v4.0.1. I'm using the standalone CLI tool (via homebrew) because I'm developing a site entirely in Go. It worked wonderfully prior to v4.0.0. My v3
Likewise my v4 tailwind.css is extremely simple:
In order to unblock my development, I've had to |
Same here! |
Similar issue with plugins. Adding custom plugins seems to crash Tailwind: /* app.css */
@import "tailwindcss";
@plugin "./myplugin.js"; // myplugin.js, https://v3.tailwindcss.com/docs/plugins#adding-components
const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin(function({ addComponents }) {
addComponents({
'.btn': {
padding: '.5rem 1rem',
borderRadius: '.25rem',
fontWeight: '600',
},
})
})
]
}
No output is produced. |
Hey! I have the same error with the plugin. No output is generated if I try to add a custom plugin. I noticed that the root cause of the error might be the following line inside my plugin file: const plugin = require('tailwindcss/plugin') Unfortunately, you don't need this because you can just export a basic function (no need to wrap it into So instead of this: const plugin = require('tailwindcss/plugin')
module.exports = plugin(function() {
// your plugin code
}) try this module.exports = function() {
// your plugin code
} This solves the problem for me and an output is generated (the plugin also works fine) |
Yeah, the docs on this are really lacking atm...
Good to know! Unfortunately this does not work for 3rd party plugins like this one (because the import is done in the plugin code): const { addIconSelectors } = require('@iconify/tailwind')
module.exports = addIconSelectors({
prefixes: ["tabler"],
scale: 1.75
}) Works perfectly fine when adding |
Does anyone have updates/workarounds on this topic? 🤔 |
@axzilla |
Yeah it works now, thanks! =) |
…15934) This PR ensures we bundle the relevant JS APIs in the Standalone CLI like `tailwindcss`, `tailwindcss/plugin`, `tailwindcss/colors`, etc… Before, when loading plugins or configs, imports for those resources would fail. Fixes #15235 --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com>
Hey folks! The latest version of the standalone CLI should now finally contain (and resolve) the JavaScript APIs as expected. |
What version of Tailwind CSS are you using?
v4.0.0-beta.3
What build tool (or framework if it abstracts the build tool) are you using?
None
What version of Node.js are you using?
v22.8.0
What browser are you using?
N/A
What operating system are you using?
Ubuntu 24.10
Reproduction URL
https://github.com/leifmetcalf/tailwind-repro/tree/8cfa9c2b2b13a3d3e87cc115000ee553ea0a11df
Describe your issue
Run this command in the reproduction repo above
The command returns error code 1 with no message. Installing tailwind with
npm install tailwindcss
fixes the problem and the output file is created as expected.The text was updated successfully, but these errors were encountered: