-
Notifications
You must be signed in to change notification settings - Fork 710
Closed
Description
Reproduction link or steps
- Open https://stackblitz.com/edit/github-nci4o6nk-ps3o8u9e?file=src%2Findex.js
pnpm iruns automaticallypnpm run buildruns automatically- Run
node src/index.js - Run
node dist/index.js - Run
npm run build:upto use rollup - Run
node dist/index.js
What is expected?
node dist/index.js behaves the same with node src/index.js.
In other words, node dist/index.js outputs:
foo
read
read
What is actually happening?
node dist/index.js behaves differently from node src/index.js.
In other words, node dist/index.js outputs:
undefined
read
read
System Info
StackBlitz
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@rolldown/browser: 1.0.0-beta.9-commit.43425a0Any additional comments?
rollup generates a correct output, but esbuild has the same incorrect behavior (bundler.sxzz.dev)
If setup.js is marked as sideeffect free (enable the plugin in the repro), the output is expected (as moduleSideEffects is lying).
Originally reported at vitejs/rolldown-vite#182
Reactions are currently unavailable