Rails 5/6: How to include JS functions with webpacker?
问题 I am trying to update a Rails 3 app to Rails 6 and I have problems with the now default webpacker since my Javascript functions are not accessible. I get: ReferenceError: Can't find variable: functionName for all js function triggers. What I did is: create an app_directory in /app/javascript copied my development javascript file into the app_directory and renamed it to index.js added console.log('Hello World from Webpacker'); to index.js added import "app_directory"; to /app/javascript/packs