esbuild
esbuild copied to clipboard
esbuild doesn't remove unused imports from external modules
Tested against:
export { useRoute } from "vue-router"
The command I ran:
esbuild index.js --bundle --outfile=out.js --external:vue --format=esm
Result, unused imports from vue
:

Online playground:
https://stackblitz.com/edit/node-fm1edb?file=readme.md
same problem here...
// helper.js
import scrollIntoView from "scroll-into-view";
export async function centerScroll(){
return scrollIntoView(/* ... */)
}
export async function delay(){
// ...
}
import {delay} from "./helper.js"
/* this causes scrollIntoView to also be in the bundle! */
darn it! i was going to move to esbuild
any updates on this?
i wish this could be fixed, esbuild is literally perfect.... except this problem, one of the reasons to use a bundler is because of the tree shaking
Any updates on this? Maybe a plugin could help?
Darn I'm seeing this as well...
Thought I was going mad. Also seeing this when using named imports
hopefully one day....
Any updates? esbuild bundles everything