Skip to content

Commit e307113

Browse files
fix: logic
1 parent c69ea9b commit e307113

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class CssMinimizerPlugin {
622622
innerSourceMap,
623623
true,
624624
);
625-
} else if (typeof item.code !== "undefined") {
625+
} else if (typeof item.code !== "undefined" && item.code !== null) {
626626
output.source = new RawSource(item.code);
627627
}
628628
}

test/__snapshots__/minify-option.test.js.snap

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,7 @@ exports[`"minify" option should work with "csso" minifier: warning 1`] = `[]`;
510510

511511
exports[`"minify" option should work with empty code: assets 1`] = `
512512
{
513-
"foo.css": "body {
514-
color: red;
515-
}
516-
a {
517-
color: blue;
518-
}
519-
520-
/*# sourceMappingURL=foo.css.map*/",
521-
"foo.css.map": "{"version":3,"file":"foo.css","mappings":"AAAA;EACE,UAAU;AACZ;AACA;EACE,WAAW;AACb,C","sources":["webpack:///./foo.css"],"sourcesContent":["body {\\n color: red;\\n}\\na {\\n color: blue;\\n}"],"names":[],"sourceRoot":""}",
513+
"foo.css": "",
522514
}
523515
`;
524516

0 commit comments

Comments
 (0)