code: def collect_dashboard_js(collector):
      
      dashmat = collector.configuration["dashmat"]
  
      modules = collector.configuration["__active_modules__"]
      compiled_static_prep = dashmat.compiled_static_prep
      compiled_static_folder = dashmat.compiled_static_folder
  
      npm_deps = list_npm_modules(collector, no_print=True)
      react_server = ReactServer()
      react_server.prepare(npm_deps, compiled_static_folder)
  
      for dashboard in collector.configuration["dashboards"].values():
          log.info("Generating compiled javascript for dashboard:{0}".format(dashboard.path))
          filename = dashboard.path.replace("_", "__").replace("/", "_")
          location = os.path.join(compiled_static_folder, "dashboards", "{0}.js".format(filename))
          if os.path.exists(location):
              os.remove(location)
          generate_dashboard_js(dashboard, react_server, compiled_static_folder, compiled_static_prep, modules)
docs: Generate dashboard javascript for each dashboard