Skip to content

[Bug]: External moduled css import paths transformed #1066

@Netail

Description

@Netail

Version

System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.96 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 137.0.7151.104
    Edge: 137.0.3296.83
    Safari: 18.5
  npmPackages:
    @rslib/core: 0.10.0

Details

External moduled css files get transformed, to use the .js file extension, while a .js file might not even exist.

import pantry from '@org/design-system/design-tokens.module.css';

becomes

import design_tokens_module from "@org/design-system/design-tokens.module.js";

Reproduce link

https://codepen.io/Justineo/pen/yLbxxOR

Reproduce Steps

  1. Have an import for a moduled css files from an external library
  2. Build library with cssModules enabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions