Here is an idea for an extension to the JSRuntime. With this extension, you can pass the Component to import and execute JS files, eliminating the need to manually write the directory. Here is an example:
I've created two examples: one where you need to use 'disposable,' and the other automatically disposes of the reference after the execution is completed.