~fancycade/rebar3_tailwind

Rebar3 tailwind compilation plugin
d588ffb6 — Harley Swick 1 year, 4 months ago
Fix app version
1dc60a0c — Harley Swick 1 year, 4 months ago
Fix app src
d33d72b6 — Harley Swick 1 year, 4 months ago
Updates to app.src and README fixes

clone

read-only
https://git.sr.ht/~fancycade/rebar3_tailwind
read/write
git@git.sr.ht:~fancycade/rebar3_tailwind

You can also use your local clone with git send-email.

#rebar3_tailwind

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

#Build

$ rebar3 compile

#Use

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

#Contributing

Send patches to:

~fancycade/public-inbox@lists.sr.ht

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

#License

Apache v2