Skip to content

Commit e6395c8

Browse files
bradlcadamwathan
authored andcommitted
replace parse-glob (fixes tailwindlabs#4454) (tailwindlabs#4458)
1 parent 1849e35 commit e6395c8

File tree

3 files changed

+66
-190
lines changed

3 files changed

+66
-190
lines changed

package-lock.json

Lines changed: 60 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@
7474
"dlv": "^1.1.3",
7575
"fast-glob": "^3.2.5",
7676
"fs-extra": "^10.0.0",
77+
"glob-parent": "^6.0.0",
7778
"html-tags": "^3.1.0",
79+
"is-glob": "^4.0.1",
7880
"lodash": "^4.17.21",
7981
"lodash.topath": "^4.5.2",
8082
"modern-normalize": "^1.1.0",
8183
"node-emoji": "^1.8.1",
8284
"normalize-path": "^3.0.0",
8385
"object-hash": "^2.1.1",
84-
"parse-glob": "^3.0.4",
8586
"postcss-js": "^3.0.3",
8687
"postcss-nested": "5.0.5",
8788
"postcss-selector-parser": "^6.0.6",

src/jit/lib/setupTrackingContext.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import fs from 'fs'
22
import path from 'path'
33

44
import fastGlob from 'fast-glob'
5-
import parseGlob from 'parse-glob'
5+
import isGlob from 'is-glob'
6+
import globParent from 'glob-parent'
67
import LRU from 'quick-lru'
78

89
import hash from '../../util/hashConfig'
@@ -104,16 +105,11 @@ export default function setupTrackingContext(configOrPath, tailwindDirectives, r
104105
if (tailwindDirectives.size > 0) {
105106
// Add template paths as postcss dependencies.
106107
for (let maybeGlob of context.candidateFiles) {
107-
let {
108-
is: { glob: isGlob },
109-
base,
110-
} = parseGlob(maybeGlob)
111-
112-
if (isGlob) {
108+
if (isGlob(maybeGlob)) {
113109
// rollup-plugin-postcss does not support dir-dependency messages
114110
// but directories can be watched in the same way as files
115111
registerDependency(
116-
path.resolve(base),
112+
path.resolve(globParent(maybeGlob)),
117113
env.ROLLUP_WATCH === 'true' ? 'dependency' : 'dir-dependency'
118114
)
119115
} else {

0 commit comments

Comments
 (0)