Skip to content

new URL(“./path/to/file.css”, import.meta.url) is incorrect #1047

Open
@sgarfinkel

Description

Bug report

The mini-css-extract-plugin prevents webpack from resolving URLs to the emitted CSS asset. Instead, this is resolved to the JS chunk, which contains no data. The expected result is that this instead resolves appropriately to the actual CSS asset.

Actual Behavior

See above. The URL will resolve to the JS chunk instead of the CSS asset.

Expected Behavior

The URL should resolve to the emitted CSS asset.

How Do We Reproduce?

Very easy to reproduce, simply bundle a URL that points to a CSS file.

Please paste the results of npx webpack-cli info here, and mention other relevant information

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions