Skip to content

Commit b4a4139

Browse files
committed
fix: 🐛 empty scss content throwing error
1 parent 717db50 commit b4a4139

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/transformers/scss.ts

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ const transformer: Transformer<Options.Sass> = async ({
2828

2929
options.data = options.data ? options.data + content : content;
3030

31+
// scss errors if passed an empty string
32+
if (options.data.length === 0) {
33+
return { code: options.data };
34+
}
35+
3136
return new Promise<Processed>((resolve, reject) => {
3237
sass.render(options, (err, result) => {
3338
if (err) return reject(err);

0 commit comments

Comments
 (0)