fix: process async entries with forceSideEffects in global mode (#18315) by samarthsinh2660 · Pull Request #20251 · webpack/webpack

@samarthsinh2660

…ack#18315)

When usedExports is set to 'global', async entries (workers) were not
being processed with forceSideEffects: true, causing CommonJS modules
with self-reference dependencies to throw 'Self-reference dependency
has unused export name' errors.

This fix ensures async entries are always processed with forceSideEffects
regardless of global mode, using undefined (global runtime) when global
mode is enabled.

@alexander-akait

This was referenced

Dec 22, 2025