Skip to content

Pass argument to tailwind cli #136

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

Closed
muriloime opened this issue Jan 24, 2022 · 3 comments
Closed

Pass argument to tailwind cli #136

muriloime opened this issue Jan 24, 2022 · 3 comments

Comments

@muriloime
Copy link

muriloime commented Jan 24, 2022

Hi all, how can one pass arguments to tailind css CLI. I was expecting something like

rails tailwindcss:build --minify

to minify css ( by reducing class names, in production), but this doesn't work. Is it possible to do such thing? If not, can you point into the right direction so I can help with the project ?

[edited to correct command line]

Many thanks
Murilo

@muriloime muriloime changed the title Pass argumet to tailwind cli Pass argument to tailwind cli Jan 24, 2022
@dixpac
Copy link
Contributor

dixpac commented Jan 26, 2022

Rake task that builds the tailwind would need to be enhanced to receive options such as --minify. But, I'm not sure if that is really necessary since TW already is small with the JIT.
How much is to gain with the minification?

@muriloime
Copy link
Author

Hi @dixpac ,

In my application I ran

tailwindcss -i app/assets/stylesheets/application.tailwind.css -c config/tailwind.config.js -o teste.css
tailwindcss -i app/assets/stylesheets/application.tailwind.css -c config/tailwind.config.js -m -o teste2.css

Which generated files of sizes 66.4kb and 46.9kb ( i.e. 40% of reduction).

But I think there are are other gains if we are able to pass arguments to tailwindcss from rails tailwindcss:build, such as allowing more flexibility through use of this gem.

Many thanks
Murilo

@dixpac
Copy link
Contributor

dixpac commented Feb 19, 2022

@dhh fixed this via c76f5d2

@dhh dhh closed this as completed Feb 19, 2022
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

3 participants