Skip to content

Commit cd0f0cf

Browse files
committed
Add back broken anchor, expand on TAILWIND_MODE=watch documentation
1 parent 684ddf0 commit cd0f0cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pages/docs/just-in-time-mode.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ We recommend you always compile your CSS in a separate one-off build before depl
489489

490490
If you want Tailwind to rebuild the CSS completely from scratch while in watch mode, saving your `tailwind.config.js` file or your CSS input file will invalidate all of the caches and trigger a fresh rebuild.
491491

492+
<a name="watch-mode-and-one-off-builds" style={{'scroll-margin-top': '6.875rem'}}></a>
493+
492494
### Styles don't update when saving content files
493495

494496
As of Tailwind CSS v2.2+, the JIT engine depends on PostCSS's [directory dependency messages](https://github.com/postcss/postcss/blob/main/docs/guidelines/runner.md#3-dependencies) to register your content files as CSS build dependencies with your build tool. These are a fairly new addition to PostCSS (added in May 2021), and not all build tools have been updated to support them yet.
@@ -515,11 +517,9 @@ For example, if you are using `postcss-cli`, set `TAILWIND_MODE=watch` in your d
515517

516518
_If you're using Windows, we recommend [cross-env](https://www.npmjs.com/package/cross-env) for setting environment variables in your scripts._
517519

518-
<a name="watch-mode-and-one-off-builds" style={{'scroll-margin-top': '6.875rem'}}></a>
519-
520-
### One-off builds are hanging
520+
Note that setting `TAILWIND_MODE=watch` will start a long-running watch process in the background, so if you set that environment variable when trying to do a one-off build, it will look like the build is hanging.
521521

522-
Note that setting `TAILWIND_MODE=watch` will start a long-running watch process in the background, so if you set that environment variable when trying to do a one-off build, it will look like the build is hanging. You should only set `TAILWIND_MODE=watch` when you are actually running a dev server/watch process.
522+
You should only set `TAILWIND_MODE=watch` when you are actually running a dev server/watch process, and only if your build tool doesn't yet support PostCSS directory dependency messages. This flag is a temporary workaround for incompatible tooling, and will eventually be removed in a future version of Tailwind CSS.
523523

524524
### Styles rebuild in an infinite loop
525525

0 commit comments

Comments
 (0)