I am using ASP.NET MVC and I have a javascript file in ~Scripts/bundle/build.js. The file is generated with webpack, which renders a bunch of ES6 javascript files in Scripts. I am loading bundle.js first and then calling the function in a different script like this:
// @Scripts.Render("~/bundles/Webpack")
<script src="~/Scripts/build/bundle.js"></script>
<script>
connectToVnc();
</script>
(first line is commented, I have tried loading the script using bundles in BundleConfig.cs).
I get the error connectToVnc is not defined, even though it is defined in bundle.js.
What am I doing wrong?