ref: d588ffb6ac489018f6ee7dfafa45118fbe08dc1c rebar3_tailwind/README.md -rw-r--r-- 1.5 KiB
d588ffb6Harley Swick Fix app version 10 months ago


A rebar plugin to trigger tailwind css compilation with rebar compile.


$ rebar3 compile


Follow the tailwind docs to setup tailwind for your project. Specifically, you'll need to install the tailwindcss executable.

Add the plugin to your project's rebar.config:

{plugins, [rebar3_tailwind]}.

Also set the tailwind options to figure out what the input and output paths should be. This is currently limited to a single input path. Patches are welcome to expand this. :

{tailwind_opts, [{input, "./apps/my_project/priv/input.css"},
                 {output, "./apps/my_project/priv/static/assets/output.css"}]}.

In this example I am putting my required input.css file in the priv directory of my application. Most likely, this is what you want to do as well. It is also recommended to add your output.css file gitignore.

Set the compile provider hook:

{provider_hooks, [
                 {post, [{compile, {tailwind, compile}}]}

It is recommended to set it as post, not pre. The logic being, we don't care what our website looks like if the erlang application can't even compile.

Then simply compile your project and your compiled css will be at the output path:

$ rebar3 compile


Send patches to:


If you are new to email based git workflows please refer to this tutorial.


Apache v2