Skip to content

Commit 978b5c2

Browse files
committed
getting back injectableSource
1 parent cea7db0 commit 978b5c2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ function isModule(pathname) {
3535
* @return {object}
3636
*/
3737
function load(sourceString, sourcePath, trace, pathFetcher) {
38-
const result = postcss(plugins.concat(new Parser({ pathFetcher, trace })))
39-
.process(sourceString, {from: sourcePath})
40-
.root;
38+
const lazyResult = postcss(plugins.concat(new Parser({ pathFetcher, trace })))
39+
.process(sourceString, {from: sourcePath});
4140

42-
return result.tokens;
41+
return { injectableSource: lazyResult.css, exportTokens: lazyResult.root.tokens };;
4342
}
4443

4544
/**
@@ -66,7 +65,7 @@ function fetch(_newPath, _relativeTo, _trace) {
6665
}
6766

6867
const source = readFileSync(fileRelativePath, 'utf-8');
69-
const exportTokens = load(source, rootRelativePath, trace, fetch);
68+
const { exportTokens, injectableSource } = load(source, rootRelativePath, trace, fetch);
7069

7170
tokensByFile[fileRelativePath] = exportTokens;
7271

0 commit comments

Comments
 (0)