Skip to content

Commit 147d32d

Browse files
authored
doc adjustments - usage with NPM managed version (#131)
1 parent b658f74 commit 147d32d

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

lib/tailwind.ex

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule Tailwind do
22
# https://github.com/tailwindlabs/tailwindcss/releases
3-
@latest_version "4.0.9"
3+
@latest_version "4.1.11"
44

55
@moduledoc """
66
Tailwind is an installer and runner for [tailwind](https://tailwindcss.com/).
@@ -44,26 +44,28 @@ defmodule Tailwind do
4444
it (for example, GitHub behind a proxy), you may want to
4545
set the `:path` to a configurable system location.
4646
47-
For instance, you can install `tailwind` globally with `npm`:
47+
For instance, you can install `tailwind` and its CLI tool with `npm`.
4848
49-
$ npm install -g tailwindcss
49+
From `/assets`:
5050
51-
On Unix, the executable will be at:
51+
$ npm install tailwindcss @tailwindcss/cli
5252
53-
NPM_ROOT/tailwind/node_modules/tailwind-TARGET/bin/tailwind
53+
Then adjust your configuration:
5454
55-
On Windows, it will be at:
56-
57-
NPM_ROOT/tailwind/node_modules/tailwind-windows-(32|64)/tailwind.exe
58-
59-
Where `NPM_ROOT` is the result of `npm root -g` and `TARGET` is your system
60-
target architecture.
61-
62-
Once you find the location of the executable, you can store it in a
63-
`MIX_TAILWIND_PATH` environment variable, which you can then read in
64-
your configuration file:
65-
66-
config :tailwind, path: System.get_env("MIX_TAILWIND_PATH")
55+
config :tailwind,
56+
# check if in sync with /assets/package.json
57+
version: "#{@latest_version}",
58+
default: [
59+
args: ~w(
60+
--input=css/app.css
61+
--output=../priv/static/assets/app.css
62+
),
63+
cd: Path.expand("../assets", __DIR__),
64+
],
65+
# skip executable check/download
66+
version_check: false,
67+
# path to npm managed CLI tool
68+
path: Path.expand("../assets/node_modules/.bin/tailwindcss", __DIR__)
6769
6870
"""
6971

0 commit comments

Comments
 (0)