Skip to content

Need way to correct relative paths to url() assets in CSS file. #20

@craighutch

Description

@craighutch

If publicPath is "dist/", both the CSS entry file and assets will be placed in the "dist/" folder, but the CSS file will contain markup with relative paths such as this:

div {
  background-image: url("dist/assets/bg.jpg");
}

Such assets are relative to the CSS file itself, not to the document's <base href/>, so the browser will try to fetch "dist/dist/assets/bg.jpg", which returns a 404 because it's an invalid path.

Need a way to adjust these paths to be relative to the generated CSS file.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions