Commit 6561708
authored
Fix pathname parsing for tracked files (tailwindlabs#5008)
The trackedModified call in the tracking logic has a bug that
incorrectly removes `null` from pathnames
Currently:
```
let pathname = parsed.href.replace(parsed.hash, '').replace(parsed.search, '')
```
Where if `parsed.hash` or `parsed.search` are missing (which is
mostly the case for FS files), the value is null
eg `{ hash: null, search: null}`
- In which case, we essentially trim `null`
converting `/mypath/nulldir/file.js` -> `/mypath/dir/filejs` and
breaking builds (see tailwindlabs#4920 ).
Fix checks if `hash` or `search` are set before replacing them
Fixes tailwindlabs#49201 parent 8218aa6 commit 6561708
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
0 commit comments