add a link to the docs describing JIT watch mode (#4332)

This will help people, when the process looks like it is "hanging",
while in fact it is watching for changes.
This commit is contained in:
Robin Malfait 2021-05-12 19:44:48 +02:00 committed by GitHub
parent 99f4c5f350
commit 87a4516871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ import resolveConfig from '../../../resolveConfig'
import corePlugins from '../corePlugins'
import isPlainObject from '../../util/isPlainObject'
import escapeClassName from '../../util/escapeClassName'
import log from '../../util/log'
import nameClass from '../../util/nameClass'
import { coerceValue } from '../../util/pluginUtils'
@ -286,6 +287,11 @@ function rebootWatcher(context) {
(env.TAILWIND_MODE === undefined && env.NODE_ENV === 'development')
) {
Promise.resolve(context.watcher ? context.watcher.close() : null).then(() => {
log.info([
'Tailwind CSS is watching for changes...',
'https://tailwindcss.com/docs/just-in-time-mode#watch-mode-and-one-off-builds',
])
context.watcher = chokidar.watch([...context.candidateFiles, ...context.configDependencies], {
ignoreInitial: true,
})