mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
add back whitespace checks but limited to 33 bytes
This commit is contained in:
@@ -2051,7 +2051,7 @@ pub fn IncrementalGraph(side: bake.Side) type {
|
||||
if (Environment.allow_assert) {
|
||||
switch (kind) {
|
||||
.css => bun.assert(code.len == 0),
|
||||
.js => if (code.len == 0 or (code.len < 33 and std.mem.trimLeft(u8, code, "\n\r ").len == 0)) {
|
||||
.js => if (bun.strings.isSmallAndOnlyWhitespace(code)) {
|
||||
// Should at least contain the function wrapper
|
||||
bun.Output.panic("Empty chunk is impossible: {s} {s}", .{
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user