Skip to content

Commit

Permalink
use dir-dependency messages (#4388)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed May 20, 2021
1 parent 93cfe97 commit 787348b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/jit/index.js
Expand Up @@ -26,7 +26,7 @@ export default function (configOrPath = {}) {
type,
plugin: 'tailwindcss-jit',
parent: result.opts.from,
file: fileName,
[type === 'dir-dependency' ? 'dir' : 'file']: fileName,
})
}

Expand Down
10 changes: 6 additions & 4 deletions src/jit/lib/expandTailwindAtRules.js
Expand Up @@ -156,10 +156,12 @@ export default function expandTailwindAtRules(context, registerDependency, tailw
} = parseGlob(maybeGlob)

if (isGlob) {
// register base dir as `dependency` _and_ `context-dependency` for
// increased compatibility
registerDependency(path.resolve(base))
registerDependency(path.resolve(base), 'context-dependency')
// rollup-plugin-postcss does not support dir-dependency messages
// but directories can be watched in the same way as files
registerDependency(
path.resolve(base),
process.env.ROLLUP_WATCH === 'true' ? 'dependency' : 'dir-dependency'
)
} else {
registerDependency(path.resolve(maybeGlob))
}
Expand Down

0 comments on commit 787348b

Please sign in to comment.