In my case, I had to run "grunt watch" (the node package).
I built a docker with node:14-bullseye and installed watchman (with apt), then executed "npm install" and finally "npx grunt watch". After that, my JS file was loaded.
This page helped me too: https://docs.moodle.org/dev/Javascript_Modules