Skip to content

Composing a class from a different file does not pass that class through getLocalIdent #636

@pillowfication

Description

@pillowfication

What is the current behavior?
Composing a class from a different file does not pass that class through getLocalIdent.

use: [{
  loader: 'css-loader',
  options: {
    modules: true,
    importLoaders: 2,
    localIdentName: '[local]',
    getLocalIdent: (context, localIdentName, localName, options) => 'prefix-' + localName,
}, {
  loader: 'sass-loader'
}]
// foo.scss
.foo { color: red; }

// bar.scss
.bar { composes: foo from "./foo.scss"; }
import styles from './bar.scss'
console.log(styles.bar)
// -> "prefix-bar foo"

What is the expected behavior?
I expected the same behavior as I would get when I compose from the same file.

// bar.scss
.foo { color: red; }
.bar { composes: foo; }
import styles from './bar.scss'
console.log(styles.bar)
// -> "prefix-bar prefix-foo"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions