You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-10
Original file line number
Diff line number
Diff line change
@@ -60,10 +60,26 @@ The `tailwindcss:build` task is automatically attached to the `test:prepare` Rak
60
60
61
61
### Update assets automatically
62
62
63
-
While you're developing your application, you want to run Tailwind in "watch" mode, so changes are automatically reflected in the generated CSS output. You can do this by:
63
+
While you're developing your application, you want to run Tailwind in "watch" mode, so changes are automatically reflected in the generated CSS output. You can do this in a few different ways:
64
64
65
-
- running `rails tailwindcss:watch` as a separate process,
66
-
- or by running `./bin/dev` which uses [foreman](https://github.com/ddollar/foreman) to start both the Tailwind watch process and the rails server in development mode.
65
+
- use the [Puma](https://puma.io/) plugin to integrate "watch" with `rails server`, or
66
+
- run `rails tailwindcss:watch` as a separate process, or
67
+
- run `bin/dev` which uses [Foreman](https://github.com/ddollar/foreman)
68
+
69
+
#### Puma plugin
70
+
71
+
The Puma plugin requires you to add this line to your `puma.rb` configuration:
and then running `rails server` will run the Tailwind watch process in the background
78
+
79
+
80
+
#### Run `rails tailwindcss:watch`
81
+
82
+
This is a flexible command, which can be run with a few different options.
67
83
68
84
If you are running `rails tailwindcss:watch` on a system that doesn't fully support file system events, pass a `poll` argument to the task to instruct tailwindcss to instead use polling: `rails tailwindcss:watch[poll]`. If you use `bin/dev` then you should modify your `Procfile.dev`.
69
85
@@ -72,6 +88,11 @@ If you are running `rails tailwindcss:watch` as a process in a Docker container,
72
88
If you are running `rails tailwindcss:watch` in a docker container without a tty, pass the `always` argument to the task to instruct tailwindcss to keep the watcher alive even when `stdin` is closed: `rails tailwindcss:watch[always]`. If you use `bin/dev` then you should modify your `Procfile.dev`.
73
89
74
90
91
+
#### Foreman
92
+
93
+
Running `bin/dev` invokes Foreman to start both the Tailwind watch process and the rails server in development mode based on your `Procfile.dev` file.
94
+
95
+
75
96
### Debugging with unminified assets
76
97
77
98
If you want unminified assets, you can pass a `debug` argument to the rake task, i.e. `rails tailwindcss:build[debug]` or `rails tailwindcss:watch[debug]`.
@@ -171,13 +192,6 @@ The inline version also works:
171
192
<sectionclass="bg-[url('image.svg')]">Has the image as it's background</section>
172
193
```
173
194
174
-
## Puma plugin
175
-
We provide a Puma plugin if you want to run the Tailwind watcher together with Puma and have Puma monitor and manage it. Add
0 commit comments