Skip to content

Commit e6fbc62

Browse files
authoredJul 22, 2024
fix(browser): don't bundle afterEach cleanup hooks in node entrypoint (#6192)
1 parent 291766d commit e6fbc62

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
 

‎packages/browser/rollup.config.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,22 @@ export default () =>
4343
format: 'esm',
4444
},
4545
external,
46-
plugins,
46+
plugins: [
47+
{
48+
name: 'no-side-effects',
49+
async resolveId(id, importer) {
50+
// Clipboard injects "afterEach" callbacks
51+
// We mark it as having no side effects to prevent it from being included in the bundle
52+
if (id.includes('dataTransfer/Clipboard')) {
53+
return {
54+
...await this.resolve(id, importer),
55+
moduleSideEffects: false,
56+
}
57+
}
58+
},
59+
},
60+
...plugins,
61+
],
4762
},
4863
{
4964
input: './src/client/tester/context.ts',

0 commit comments

Comments
 (0)