Sometimes an external js library used in an extension can be extended with many optional plugins, which may or may not use require() functions. I would imagine that (a) the library can be added to the "packageFiles" of the main module (so it can be imported/required in the main entry file) and that (b) a list of plugins would be added, under "scripts", to a separate 'plugin module'. If you then want to add the plugin module to packageFiles, which approach would be best/recommended if at all possible?
- the config option, pointing to the module within extension.json (if self-referentiality is at all possible), or
- the PHP callback option, pointing to a function that somehow returns the RL module.
Or is there a better and more straightforward approach I'm overlooking?