JAVASCRIPT SCOPE HOISTING IS BROKEN
JavaScript scope hoisting is an optimization used by bundlers to concatenate modules into a single scope instead of wrapping each in a function, but it breaks when combined with code splitting because it can't preserve the correct execution order of modules with side effects. This leads to different program behavior, with shared modules executing in the wrong order compared to unbundled code, affecting bundlers like Rollup, ESBuild, and others. The solution requires wrapping modules in functions to control execution order.