Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
richardkmichael opened this issue Sep 11, 2024 · 2 comments
Closed

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

richardkmichael opened this issue Sep 11, 2024 · 2 comments

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!)

@flavorjones
Copy link
Member

Closing, but still happy to review a pull request related to this.

@flavorjones flavorjones closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants