File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,17 @@ const walkRules = (css, callback) => {
111
111
} ) ;
112
112
} ;
113
113
114
+ const addExports = ( css , aliases ) => {
115
+ const { icssImports, icssExports } = extractICSS ( css ) ;
116
+ const exports = Object . assign ( { } , icssExports , aliases ) ;
117
+ css . prepend ( createICSSRules ( icssImports , exports ) ) ;
118
+ } ;
119
+
114
120
module . exports = postcss . plugin ( plugin , ( options = { } ) => css => {
115
121
const generateScopedName =
116
122
options . generateScopedName ||
117
123
genericNames ( "[name]__[local]---[hash:base64:5]" ) ;
118
124
const input = ( css && css . source && css . source . input ) || { } ;
119
- const { icssImports, icssExports } = extractICSS ( css ) ;
120
125
const aliases = { } ;
121
126
const getAlias = name => {
122
127
const alias = generateScopedName ( name , input . from , input . css ) ;
@@ -134,7 +139,5 @@ module.exports = postcss.plugin(plugin, (options = {}) => css => {
134
139
throw rule . error ( e . message ) ;
135
140
}
136
141
} ) ;
137
- css . prepend (
138
- createICSSRules ( icssImports , Object . assign ( { } , icssExports , aliases ) )
139
- ) ;
142
+ addExports ( css , aliases ) ;
140
143
} ) ;
You can’t perform that action at this time.
0 commit comments