Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace parse-glob dependency #4458

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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