Skip to content

Commit

Permalink
fix(browser): don't bundle afterEach cleanup hooks in node entrypoi…
Browse files Browse the repository at this point in the history
…nt (#6192)
  • Loading branch information
sheremet-va committed Jul 22, 2024
1 parent 291766d commit e6fbc62
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ export default () =>
format: 'esm',
},
external,
plugins,
plugins: [
{
name: 'no-side-effects',
async resolveId(id, importer) {
// Clipboard injects "afterEach" callbacks
// We mark it as having no side effects to prevent it from being included in the bundle
if (id.includes('dataTransfer/Clipboard')) {
return {
...await this.resolve(id, importer),
moduleSideEffects: false,
}
}
},
},
...plugins,
],
},
{
input: './src/client/tester/context.ts',
Expand Down

0 comments on commit e6fbc62

Please sign in to comment.