Driving me crazy because it should be so easy!!!
// file: /app/javascript/packs/application.js
require("jquery")
require("custom/sites_manage")
// file: /app/javascript/custom/sites_manage.js
console.log(">>> this file is being loaded")
function testFunc() {
return "asdf"
}
When I spin up a local server and go to the home page, in the console I do see >>> this file is being loaded
great! But then when I call testFunc()
I get: Uncaught ReferenceError: testFunc is not defined
Why??? I don't think I'm doing anything different than the numerous answers/tutorials on this topic (e.g., this one, or this one)