99 isGlobal,
1010 removeSpace,
1111 removeNotGlobals,
12+ shouldSkip,
1213} = require ( './utils' ) ;
1314
1415const mainDist = path . resolve ( __dirname , '../../dist/quark-loader-output.css' ) ;
@@ -21,7 +22,7 @@ module.exports = postcss.plugin('postcss-module-composer', () => (root) => {
2122 const identifier = rule . selector ;
2223 let once = false ;
2324 identifier . split ( ',' ) . forEach ( ( selector ) => {
24- if ( ! isGlobal ( removeSpace ( selector ) ) ) {
25+ if ( ! isGlobal ( removeSpace ( selector ) ) && ! shouldSkip ( removeSpace ( selector ) ) ) {
2526 composerString += `${ removeSpace ( selector ) } {\n` ;
2627 rule . walkDecls ( ( decl ) => {
2728 composerString += createModuleComposer ( decl . prop , decl . value ) ;
@@ -32,9 +33,11 @@ module.exports = postcss.plugin('postcss-module-composer', () => (root) => {
3233 } ) ;
3334 composerString += '}\n' ;
3435 } else if ( once === false ) {
36+ const globals = ! shouldSkip ( rule . selector )
37+ ? removeNotGlobals ( rule . selector ) : rule . selector ;
38+ composerString += `${ globals } {\n` ;
3539 rule . walkDecls ( ( decl ) => {
36- const globals = removeNotGlobals ( rule . selector ) ;
37- composerString += `${ globals } {\n${ createModuleDeclaration ( decl . prop , decl . value ) } ` ;
40+ composerString += `${ createModuleDeclaration ( decl . prop , decl . value ) } ` ;
3841 hashmap . set (
3942 createModuleSelector ( decl . prop , decl . value ) ,
4043 createModuleDeclaration ( decl . prop , decl . value ) ,
0 commit comments