Skip to content

getLocalIdent doesn't apply for composed classes #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eloytoro opened this issue Apr 28, 2017 · 3 comments
Closed

getLocalIdent doesn't apply for composed classes #524

eloytoro opened this issue Apr 28, 2017 · 3 comments

Comments

@eloytoro
Copy link

Do you want to request a feature or report a bug?
It's a bug

What is the current behavior?
getLocalIdent works for all directly required css file, but doesn't for composed classes

If the current behavior is a bug, please provide the steps to reproduce.

Loader in the webpack config

{
  test: /\.css$/,
  loader: 'css-loader',
  options: {
    modules: true,
    importLoaders: 1,
    getLocalIdent: () => 'foo'
  }
}

style1.css

.bar {
  composes: baz from './style2.css';
  color: white;
}

style2.css

.baz {
  background: red;
}

module.js

require('./style1.css') // { 'bar': 'foo _3eS695' }

What is the expected behavior?

module.js

require('./style1.css') // { 'bar': 'foo foo' }

Please mention other relevant information such as your webpack version, Node.js version and Operating System.

[email protected]
[email protected]

@eloytoro
Copy link
Author

eloytoro commented May 1, 2017

Looking at the code this seems like the intended behavior.

Why is that? how can I control the name of composed classes?

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Jul 24, 2017

@eloytoro Could you try with

webpack.config.js

{
  loader: 'css-loader'
  options: {
    ident: 'css', // <= this line, which value isn't important
    getLocalIdent: () => {}
  }
}

@alexander-akait
Copy link
Member

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants