Skip to content

[contenthash] for localIdentName #1640

Open
@Netail

Description

@Netail

Feature Proposal

Expose [contenthash] string template for localIdentName

Feature Use Case

Note

Actual issue found with rslib, an upstream of rspack, that tries to equal webpack.

We have a design system built using typescript & sass, which we in the cicd transpile/compile to javascript & CSS. We already handle CSS modules on this end, so it adds a hash at the end of the classes. This hash is the same each build, even when some lines changed.

The problem lies in our monorepo with packages & micro-frontends. Some packages use the design-system & the apps themself, where the version of the design system can differ between each. When an app gets bundled the same class could end up in the bundle twice, if a package uses a certain component & the app. If some lines get changed between versions and both versions are bundled together, you'll get clashes on the classname.

So, it would be nice to someone differentiate these 2 based on if the content has changed within the design-system so classes don't clash. And resulting in the same class hash if no changes have been made between versions.

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

Not needed

Metadata

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