I'm trying to setup "login with facebook" functionality in my application.
Everything works great locally or if I don't minify my bundle.
However when I minify my bundle output there is a global function that happens to be minified to FB (window.FB), which completely breaks the facebook SDK.
Facebook doesn't provide any way to use any other variable name. So I'm trying to figure out how to "reserve" or prevent my bundler viteJS / Rollup minifying this other global function name to FB.
The global function that's getting minified comes from nodejs and is likely being imported through some npm package but I am not sure which one. (even if I could find it, I'm using it for a reason and there might not be a good alternative).
This is the random nodejs function that's being saved on the global window and minified to be called "FB": https://github.com/nodejs/node/blob/4b6e4c1eb110e0be671ec5972bf280d2bf3892d8/lib/_stream_readable.js#L497
How can I prevent the window.FB global variable name to be taken up by this function? (with minify turned on of course).
I have tried setting build.outputs.globals.FB to "TEST", and defining window.FB in my index.ts file to see if it would force it to not use the same name for minifcation. But it doesn't seem to affect the bundler.