use href to get the full path of the file (#4044)

* use href to get the full path of the file
fixes https://github.com/tailwindlabs/tailwindcss/issues/4043

* drop query strings and document fragment from path
This commit is contained in:
Alex 2021-05-07 19:48:09 +01:00 committed by GitHub
parent b6286c9660
commit 212bec9354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,7 +234,8 @@ function trackModified(files) {
for (let file of files) {
if (!file) continue
let pathname = url.parse(file).pathname
let parsed = url.parse(file)
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
let newModified = fs.statSync(decodeURIComponent(pathname)).mtimeMs
if (!fileModifiedMap.has(file) || newModified > fileModifiedMap.get(file)) {