Skip to content

How to use lqip-loader and css-loader at the same time? #18

@UwUnyaa

Description

@UwUnyaa

I've set up lqip-loader in a project I'm working on to add lazy loading of images with LQIP with content imported via Webpack. After making changes to my React components which happen to use these images, they work correctly.

My problem is that references to images in (s)css (for instance, url() in background-image end up getting mangled into [object Object] which makes sense considering how Webpack works, but it's obviously a huge problem. Right now I'm considering writing a loader that looks whether the previous loader returned an Object that looks like something from this loader, and gets the src property of it to get the URL.

I've tried looking for solutions to the problem of this kind, but I haven't managed to find anything. I think this is a big issue (and it makes this loader unusable to quite a lot of people). Shouldn't there be some information about this in the readme with a possible workaround (maybe something like what I've mentioned abve, I haven't tried it yet myself)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions