Closed luizbills closed 3 months ago
That’s likely because esbuild doesn’t know that new AudioContext()
is side-effect free.
That’s likely because esbuild doesn’t know that
new AudioContext()
is side-effect free.
make sense!
There are something I can do?
You can mark your function-call (including new XXX()
) as side-effect free with /*@__PURE__*/
. Playground Link
You can mark your function-call (including
new XXX()
) as side-effect free with/*@__PURE__*/
.
thanks!
The bundler do not remove that "unused" AudioContext instance. Why?
https://esbuild.github.io/try/#YgAwLjIzLjEALS1idW5kbGUAZQBlbnRyeS5qcwBjb25zdCBhID0gbmV3IEF1ZGlvQ29udGV4dCgpCgpjb25zdCBiID0gKCkgPT4gYQoKZ2xvYmFsVGhpcy5jID0gKCkgPT4gImZvbyI