Skip to content

CSS asset URLs are incorrect when --entry-names is used #1044

@kaksmet

Description

@kaksmet

Running

esbuild index.css --bundle --outdir=build --entry-names=styles/[name] --asset-names=assets/[name] --loader:.png=file

with index.css looking like

.foobar {
    background-image: url(./foobar.png);
}

results in build/styles/index.css:

/* index.css */
.foobar {
  background-image: url(./assets/foobar.png);
}

Since foobar.png is copied to build/assets/foobar.png the URL should actually be ../assets/foobar.png?

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