Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

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

Description

@sgarfinkel

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions