Skip to content

Commit 56f2b91

Browse files
committed
output warnings
1 parent a85a5c3 commit 56f2b91

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ function fetch(_to, _from, _trace) {
8888
const rootRelativePath = sep + relative(rootDir, filename);
8989
const CSSSource = preProcess(readFileSync(filename, 'utf8'));
9090

91-
const result = postcss(plugins.concat(new Parser({ fetch, filename, trace })))
92-
.process(CSSSource, assign(lazyResultOpts, {from: rootRelativePath}))
93-
.root;
91+
const lazyResult = postcss(plugins.concat(new Parser({ fetch, filename, trace })))
92+
.process(CSSSource, assign(lazyResultOpts, {from: rootRelativePath}));
9493

95-
tokens = result.tokens;
94+
lazyResult.warnings().forEach(message => console.warn(message.text));
95+
96+
tokens = lazyResult.root.tokens;
97+
// updating cache
9698
tokensByFile[filename] = tokens;
9799

98100
if (postProcess) {
99-
postProcess(result.toResult().css);
101+
postProcess(lazyResult.css);
100102
}
101103

102104
return tokens;

0 commit comments

Comments
 (0)