Reproduction link or steps
- Open https://stackblitz.com/edit/github-xv4yss-lweea2?file=rolldown.config.mjs,src%2Fdynamic.js,src%2Fentry.js
npm run build runs automatically
dist/dynamic-B5a49wDx.js is an empty file and dist/entry.js imports it.
What is expected?
The empty dist/dynamic-B5a49wDx.js is removed and the import("./dynamic-B5a49wDx.js"); is replaced with Promise.resolve(). Even further, Promise.resolve() can be removed completely in this case because there's no side effect.
What is actually happening?
dist/dynamic-B5a49wDx.js is not removed and the dist/entry.js contains import("./dynamic-B5a49wDx.js");.
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: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
rolldown: https://pkg.pr.new/rolldown@01cedb9 => 0.14.0
Any additional comments?
related to #2604, #2826
Reproduction link or steps
npm run buildruns automaticallydist/dynamic-B5a49wDx.jsis an empty file anddist/entry.jsimports it.What is expected?
The empty
dist/dynamic-B5a49wDx.jsis removed and theimport("./dynamic-B5a49wDx.js");is replaced withPromise.resolve(). Even further,Promise.resolve()can be removed completely in this case because there's no side effect.What is actually happening?
dist/dynamic-B5a49wDx.jsis not removed and thedist/entry.jscontainsimport("./dynamic-B5a49wDx.js");.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: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: rolldown: https://pkg.pr.new/rolldown@01cedb9 => 0.14.0Any additional comments?
related to #2604, #2826