Hello, I am trying to figure out how to access variables in bundle.js. I want to experiment with variables and functions on the client side using JavaScript, but I'm having trouble calling them in index.html or the Chrome console.
I use browserify to bundle my script.js into bundle.js (which allows me to use 'require' since the browser doesn't recognize it). However, when I try to access variables or functions defined in script.js (now bundled into bundle.js), I receive an error such as Uncaught ReferenceError: xx is not defined.
Can anyone provide some assistance? Am I not allowed to use node packages on the client-side within HTML/scripts?
Edit: After doing some research, I found a suggestion to use XHR/AJAX from a response on this Stack Overflow thread.
Edit2: It seems like using window.xx = xx could be a temporary solution for this issue.