Skip to content

Commit

Permalink
replace parse-glob (fixes #4454) (#4458)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc authored and adamwathan committed May 26, 2021
1 parent d0a8794 commit 9a9971b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 190 deletions.
241 changes: 60 additions & 181 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
"dlv": "^1.1.3",
"fast-glob": "^3.2.5",
"fs-extra": "^10.0.0",
"glob-parent": "^6.0.0",
"html-tags": "^3.1.0",
"is-glob": "^4.0.1",
"lodash": "^4.17.21",
"lodash.topath": "^4.5.2",
"modern-normalize": "^1.1.0",
"node-emoji": "^1.8.1",
"normalize-path": "^3.0.0",
"object-hash": "^2.1.1",
"parse-glob": "^3.0.4",
"postcss-js": "^3.0.3",
"postcss-nested": "5.0.5",
"postcss-selector-parser": "^6.0.6",
Expand Down
12 changes: 4 additions & 8 deletions src/jit/lib/setupTrackingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import fs from 'fs'
import path from 'path'

import fastGlob from 'fast-glob'
import parseGlob from 'parse-glob'
import isGlob from 'is-glob'
import globParent from 'glob-parent'
import LRU from 'quick-lru'

import hash from '../../util/hashConfig'
Expand Down Expand Up @@ -104,16 +105,11 @@ export default function setupTrackingContext(configOrPath, tailwindDirectives, r
if (tailwindDirectives.size > 0) {
// Add template paths as postcss dependencies.
for (let maybeGlob of context.candidateFiles) {
let {
is: { glob: isGlob },
base,
} = parseGlob(maybeGlob)

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

0 comments on commit 9a9971b

Please sign in to comment.