Skip to content

Request: "remove_cli" command #132

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
danjac opened this issue Sep 20, 2024 · 2 comments
Closed

Request: "remove_cli" command #132

danjac opened this issue Sep 20, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@danjac
Copy link

danjac commented Sep 20, 2024

Hi, thanks first of all for a great utility!

I was wondering if it would be possible to have a Django command equivalent to download_cli, which would remove the CLI using the same path resolution i.e.

./manage.py tailwind remove_cli

This would be useful for example when building a Docker image, where you might build the Tailwind CSS and then remove the CLI, as you no longer need it in production and you want to keep the image as small as possible.

@oliverandrich
Copy link
Member

@danjac This sounds like a reasonable addition. But I would suggest solving this using a multi-stage build. I wrote my approach in my latest blog post.

https://andrich.me/2024/09/my-ideal-uv-based-dockerfile/

Look at stage 3 and 4. In stage for, I use the tailwind command to compile my CSS. In stage 4, I assemble the production container. The trick is, that between stage 3 and 4 only the relevant files that you need in production are copied.

But I will consider your request. Nevertheless, you are welcome to provide a pull request.

@danjac
Copy link
Author

danjac commented Sep 20, 2024

Sure - multistage build worked for my use case as well.

It might still be useful to have a remove_cli command for some edge cases I guess but certainly not a priority.

Thanks again!

@oliverandrich oliverandrich added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants