ws WebSocket package.
When running as
--platform node, things are fine. However when running
--platform browser with
--external ws specified, esbuild still seems to try resolve the
ws package (albeit externally), even if the
require('ws') call is wrapped in conditional block.
const IsomorphicWebSocket: typeof WebSocket = isBrowser() ? WebSocket : require('ws').WebSocket // // this should not execute in browser environments ^
Is there a way to have esbuild completely ignore the
ws package when running
--external ws? Any info on how to approach this in esbuild would be great.