Skip to content

Commit 14bc980

Browse files
committed
fixed styles parser to parse array of style objects
1 parent 281c48d commit 14bc980

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/parser/style.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ type StyleObjectType = {
1212

1313
function styleParser(styleObjectArray: StyleObjectType[]): Promise<string> {
1414
return new Promise((resolve) => {
15+
let output = '';
1516
if (!styleObjectArray || styleObjectArray.length === 0) {
16-
resolve('');
17+
resolve(output);
1718
} else {
1819
for (const styleObject of styleObjectArray) {
1920
if(styleObject.lang === 'scss' || styleObject.lang === 'less') {
2021
console.error('Sorry please only use plain CSS in your files for now');
2122
}
22-
const output = new CleanCSS({}).minify(styleObject.content);
23-
resolve(output.styles);
23+
output += new CleanCSS({}).minify(styleObject.content).styles;
2424
}
25+
resolve(output);
2526
}
2627
});
2728
}

0 commit comments

Comments
 (0)