Skip to content

Pass customInterpolateName from query #327

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
wants to merge 5 commits into from

Conversation

Chaptykov
Copy link

It is based on top of #315 by @helloyou2012.

This PR allows to pass customInterpolateName function from webpack config to loaderUtils.interpolateName. It allows to generate classnames manually. It will solve #292.

Webpack config:

let i = 0;

module.exports = {
  module: {
    loaders: [{
      test: /\.css$/,
      loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]'
    }]
  },
  cssLoader: {
    customInterpolateName: function() {
      i++;
      return '_' + i;
    }
  }
};

For this file structure:

first.css
  .title {}
  .text {}
second.css
  .title {}

returns

._1 {} /* first.css  → .title */
._2 {} /* first.css  → .text  */
._3 {} /* second.css → .title */

@codecov-io
Copy link

codecov-io commented Sep 6, 2016

Current coverage is 98.39% (diff: 100%)

Merging #327 into master will increase coverage by 0.04%

@@             master       #327   diff @@
==========================================
  Files             9          9          
  Lines           303        312     +9   
  Methods          41         41          
  Messages          0          0          
  Branches         66         70     +4   
==========================================
+ Hits            298        307     +9   
  Misses            5          5          
  Partials          0          0          

Powered by Codecov. Last update 22f6621...015ceb5

@Chaptykov Chaptykov force-pushed the master branch 2 times, most recently from 4704b47 to d3e8726 Compare September 6, 2016 11:27
@ArtZanko
Copy link

ArtZanko commented Sep 6, 2016

+1

@MrCheater
Copy link

+1

@sokra sokra closed this Nov 17, 2016
@sokra
Copy link
Member

sokra commented Nov 17, 2016

see #348 and #357

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 this pull request may close these issues.

6 participants