lepture / python-livereload

livereload server in python
https://livereload.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.02k stars 150 forks source link

@imported stylesheets reloaded relative to html document not relative to parent stylesheet, resulting in 404 #248

Open liskin opened 3 years ago

liskin commented 3 years ago
$ cat index.html 
<!DOCTYPE html>
<html><head><link rel="stylesheet" href="css/style.css" type="text/css"></head><body></body></html>

$ cat css/style.css 
@import url("import.css")

$ cat css/import.css 
/* imported */

$ python3 -c 'from livereload import Server, shell; server = Server(); server.watch("."); server.serve();'
[I 210604 10:20:55 server:335] Serving on http://127.0.0.1:5500

When I now do touch css/import.css, livereload attempts to reload /import.css?livereload=1622798509993 instead of /css/import.css?livereload=1622798509993.