This has been answered before, but I have a peculiar problem.
I have a function
function foo() {
return 'bar';
}
in an app.js file I bundled with webpack.
Now I need to access this function from a script tag inside a html file. I tried to bind the function to the global window object, as described here, and it seemed to work.
Problem now is that other variables from plugins that I use on the same page, (which used to work fine) are now "not defined".
For example grecaptcha.execute();
now throws
grecaptcha is not defined
Could someone please suggest a way around this. I'd really appreciate an explanation to understand what is going on.