Skip to content

sideEffects: false + catch-all onResolve plugin causes live bindings to be tree-shaken from namespace exports #29445

@stefanprobst

Description

@stefanprobst

What version of Bun is running?

1.3.12

What platform is your computer?

linux

What steps can reproduce the bug?

see https://github.com/stefanprobst/issue-bun-namespace-sideeffects/blob/main/readme.md

in reproduction repro:

  • bun build.ts # builds without errors
  • bun src/index.ts # works correctly
  • bun dist/index.js # ReferenceError: foo is not defined

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

x-ref bunup/bunup#119

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions