Esbuild seems to be failing to exclude dead imports of sub files believed to be because they have a node type import. I am not sure if this bug is caused by this plugin or esbuild itself.
Reproduction
deno run -A bundle.ts
main.ts
import { random } from './lib.ts'
console.log('Hello World')
console.log(random())
lib.ts
import { Iter } from 'https://deno.land/x/iterstar@v1.1.2/mod.ts'
import { Peer } from 'https://esm.sh/peerjs@1.5.2?bundle-deps'
export function createPeer() {
return new Peer()
}
export function createIter() {
return new Iter((function* () {
let i = 0
while (true)
yield i++
})())
}
export function random() {
return Math.random()
}
Esbuild seems to be failing to exclude dead imports of sub files believed to be because they have a node type import. I am not sure if this bug is caused by this plugin or esbuild itself.
Reproduction
deno run -A bundle.ts
main.ts
lib.ts
bundle.ts
main.js expected output
The actual output includes the entire contents of the Peer import, but not the IterStar import