Skip to content
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

Allow the puma plugin to enable "debug" (no minification) #400

Open
richardkmichael opened this issue Sep 11, 2024 · 1 comment
Open

Allow the puma plugin to enable "debug" (no minification) #400

richardkmichael opened this issue Sep 11, 2024 · 1 comment

Comments

@richardkmichael
Copy link

It would be helpful if the puma plugin could permit configuration of the TailwindCSS watcher in debug mode (to generate non-minified output). It seems this is only possible when starting the watcher using rake task (and therefore also a Procfile).

The Puma configuration DSL plugin does not accept arguments other than the plug-in name, so this can't be implemented as: plugin :tailwindcss, :debug.

It could be done with an environment variable . (The plug-in already uses environment for TAILWINDCSS_INSTALL_DIR.)

A simple patch:

# lib/puma/plugin/tailwindcss.rb

def start(launcher)
    debug = ["true", "1"].include? ENV["TAILWINDCSS_DEBUG"]
    # ...
        IO.popen(Tailwindcss::Commands.watch_command(debug: debug), 'r+') do |io|
    # ...
end
@flavorjones
Copy link
Member

flavorjones commented Sep 13, 2024

@richardkmichael Thanks for suggesting this addition. I'd prefer if we addded the environment variable logic to lib/tailwindcss/commands.rb, in the compile_command method.

Are you interested in putting together a PR for that? Ideally I'd also like a test added to test/lib/tailwindcss/commands_test.rb so we don't accidentally break it in the future. (And document it in the README!)

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

2 participants