Skip to content

Commit 92da279

Browse files
committed
Hacky classnames map for locals loader
1 parent ed97c2b commit 92da279

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/localsLoader.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var assign = require("object-assign");
1111

1212
module.exports = function(content) {
1313
if(this.cacheable) this.cacheable();
14+
var that = this;
1415
var callback = this.async();
1516
var loaderOptions = loaderUtils.parseQuery(this.query);
1617
var configKey = loaderOptions.config || "cssLoader";
@@ -19,6 +20,12 @@ module.exports = function(content) {
1920
var moduleMode = query.modules || query.module;
2021
var camelCaseKeys = query.camelCase || query.camelcase;
2122

23+
if (!this._compilation.cssLoader) {
24+
this._compilation.cssLoader = {
25+
classnames: []
26+
};
27+
}
28+
2229
processCss(content, null, {
2330
mode: moduleMode ? "local" : "global",
2431
query: query,
@@ -27,6 +34,11 @@ module.exports = function(content) {
2734
}, function(err, result) {
2835
if(err) return callback(err);
2936

37+
that._compilation.cssLoader.classnames.push({
38+
file: result.map.file,
39+
exports: result.exports
40+
});
41+
3042
// for importing CSS
3143
var importUrlPrefix = getImportPrefix(this, query);
3244

0 commit comments

Comments
 (0)