How to import Grafana modules (eg. public/app/core) into custom panel plugin

@marcusolsson @vsergeyev @daniellee @svetb @yosiasz

Can I please get any insight on this, I tried to build a custom plugin myself in data/plugins folder.(the plugin actually extends the functionality of existing grafana panel plugin) .I copied the source and shipped it to data/plugins folder. The new plugin needs to make use of native typescript files like app/features/explore/utils/links, app/core/services, app/types etc. while building it gives [Cannot find modules or corresponding type declarations error]
In order to resolve these module load errors, I tried to tweak the tsconfig.json by introducing path mappings and tools like tsmodule-alias so that I can map these @app components by aliasing. But this didn’t help.

Can you’ll please suggest a better way to “import public/app folder inside custom panel plugin”?

1 Like

I have tried to use some bundlers to resolve module load errors for the compile/runtime java script errors that I’m facing:
Use this as a reference

or this

These helped me in giving a successful build but, grafana fails to pick up my new/customized panel plugin in UI.

ps: node-panel is my new panel plugin in data/plugins folder