File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,11 @@ let rootDir;
2222 * @return {object }
2323 */
2424function load ( sourceString , sourcePath , trace , pathFetcher ) {
25- // @todo To think about a better way to export tokens from the plugin
26- let exportTokens = { } ;
27-
28- let result = postcss ( plugins . concat ( new parser ( { exportTokens, pathFetcher, trace } ) ) )
25+ let result = postcss ( plugins . concat ( new parser ( { pathFetcher, trace } ) ) )
2926 . process ( sourceString , { from : '/' + sourcePath } )
30- . stringify ( ) ;
27+ . root ;
3128
32- return { injectableSource : result . css , exportTokens : exportTokens } ;
29+ return { injectableSource : result . css , exportTokens : result . tokens } ;
3330}
3431
3532hook ( filename => {
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ const importRegexp = /^:import\((.+)\)$/
77export default plugin ( 'parser' , function ( opts ) {
88 opts = opts || { } ;
99
10- // have to export it outside of the plugin :()
11- let exportTokens = opts . exportTokens ;
10+ let exportTokens = { } ;
1211 let translations = { } ;
1312
1413 const fetchImport = ( importNode , relativeTo , depNr ) => {
@@ -63,5 +62,6 @@ export default plugin('parser', function (opts) {
6362 fetchAllImports ( css ) ;
6463 linkImportedSymbols ( css ) ;
6564 extractExports ( css ) ;
65+ css . tokens = exportTokens ;
6666 }
6767} ) ;
You can’t perform that action at this time.
0 commit comments