Skip to content

Commit bb8713c

Browse files
authored
chore: Silence Rollup's this is undefined warnings (#991)
* chore: Silence Rollup's `this is undefined` warning * docs: Adding changeset
1 parent 22187fb commit bb8713c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/swift-plums-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Silence Rollup's noisy (and usually harmless) `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten.` warnings

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function createConfig(options, entry, format, writeMeta) {
475475
`\n ↳ to depend on a module via import/require, install it to "dependencies".`,
476476
);
477477
return;
478-
}
478+
} else if (warning.code === 'THIS_IS_UNDEFINED') return;
479479

480480
warn(warning);
481481
},

0 commit comments

Comments
 (0)