Skip to content

CSS Modules hashes are unstable depending on working directory #355

@markdalgleish

Description

@markdalgleish

When calling bundle / bundleAsync with CSS Modules enabled, consumers can provide either an absolute path or a cwd relative path for the filename option, but this means that hashes would be unstable depending on the current working directory. In order to ensure hashes are stable, it would be nice to have a cwd option too, e.g.

lightningcss.bundle({
  filename: 'styles/index.css',
  cwd: appRootDirectory,
  cssModules: {
    pattern: "[hash]_[name]_[local]"
  },
});

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