File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ var compileExports = require("./compile-exports");
1212
1313module . exports = function ( content , map ) {
1414 if ( this . cacheable ) this . cacheable ( ) ;
15+ var that = this ;
1516 var callback = this . async ( ) ;
1617 var loaderOptions = loaderUtils . parseQuery ( this . query ) ;
1718 var configKey = loaderOptions . config || "cssLoader" ;
@@ -21,6 +22,12 @@ module.exports = function(content, map) {
2122 var moduleMode = query . modules || query . module ;
2223 var camelCaseKeys = query . camelCase || query . camelcase ;
2324
25+ if ( ! this . _compilation . cssLoader ) {
26+ this . _compilation . cssLoader = {
27+ classnames : [ ]
28+ } ;
29+ }
30+
2431 if ( map !== null && typeof map !== "string" ) {
2532 map = JSON . stringify ( map ) ;
2633 }
@@ -32,9 +39,16 @@ module.exports = function(content, map) {
3239 query : query ,
3340 minimize : this . minimize ,
3441 loaderContext : this
35- } , function ( err , result ) {
42+ } ,
43+
44+ function ( err , result ) {
3645 if ( err ) return callback ( err ) ;
3746
47+ that . _compilation . cssLoader . classnames . push ( {
48+ file : result . map . file ,
49+ exports : result . exports
50+ } ) ;
51+
3852 var cssAsString = JSON . stringify ( result . source ) ;
3953
4054 // for importing CSS
You can’t perform that action at this time.
0 commit comments