File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,12 +111,17 @@ const walkRules = (css, callback) => {
111111 } ) ;
112112} ;
113113
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+
114120module . exports = postcss . plugin ( plugin , ( options = { } ) => css => {
115121 const generateScopedName =
116122 options . generateScopedName ||
117123 genericNames ( "[name]__[local]---[hash:base64:5]" ) ;
118124 const input = ( css && css . source && css . source . input ) || { } ;
119- const { icssImports, icssExports } = extractICSS ( css ) ;
120125 const aliases = { } ;
121126 const getAlias = name => {
122127 const alias = generateScopedName ( name , input . from , input . css ) ;
@@ -134,7 +139,5 @@ module.exports = postcss.plugin(plugin, (options = {}) => css => {
134139 throw rule . error ( e . message ) ;
135140 }
136141 } ) ;
137- css . prepend (
138- createICSSRules ( icssImports , Object . assign ( { } , icssExports , aliases ) )
139- ) ;
142+ addExports ( css , aliases ) ;
140143} ) ;
You can’t perform that action at this time.
0 commit comments