Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 20b084e

Browse files
committed
Fail loudly when CSS AST cannot be parsed
1 parent 1419d23 commit 20b084e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

extract.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,8 @@ function loadBabelOpts(opts) {
157157
function literalParser(source, opts, styles) {
158158
let ast;
159159

160-
try {
161-
ast = parse(source, loadBabelOpts(opts));
162-
} catch (ex) {
163-
// console.error(ex);
164-
return styles || [];
165-
}
160+
// Fail loudly when AST cannot be parsed for some reason
161+
ast = parse(source, loadBabelOpts(opts));
166162

167163
const specifiers = new Map();
168164
const variableDeclarator = new Map();

0 commit comments

Comments
 (0)