Skip to content

relative css @imports result in 404 requests #37

Open
@pascalpp

Description

@pascalpp

I have a CSS file at /css/main.css which imports other CSS files in subdirectories of /css, using relative @import statements.

image

When I make edits, livereload makes a request for /lib/text.css, which should be /css/lib/text.css, resulting in a 404.

image

I thought maybe this was an issue with my app stack, which is complicated, so I made a new barebones repo which demonstrates the issue, using grunt-contrib-connect and grunt-contrib-watch.

The demo repo is https://github.com/pascalpp/grunt-watch-reload-issue. To replicate the issue, clone that repo locally, run npm install and grunt, and then open http://localhost:9090 and follow the instructions shown there.

The issue also occurs when I connect to the standalone LiveReload app (from the Mac App Store).

Obviously I could change the CSS imports to be root-relative, but that breaks other things, like my CSS minimizer.

If anyone has any insight on this issue, I'd really appreciate it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions