Import Grafana modules into custom plugin

I’m trying to create a customized version of the InfluxDB datasource that is tailored to my specific usecase. I copied the source for the shipped InfluxDB datasource into a new folder in data/plugins, and pulled in grunt and typescript configurations from the typescript-template-datasource. I added triple slash references for grafana-sdk-mocks to my new version of the InfluxDB datasource code as described in the documentation for the sdk mocks.

The thing that’s causing me trouble is that the original InfluxDB plugin imports app/core/components/query_part/query_part. First, query_part isn’t part of the SDK mocks. So I added a declaration to common.d.ts in the sdk mocks for the exported classes/functions in query_parts. Now my plugin compiles, but when I try to use the new datasource in grafana, I get 404 errors saying that there were problems instantiating http://localhost:3000/public/app/core/components/query_part/query_part

The path to the module looks right, so my suspicion is that there’s something in the Grafana build/deploy process that makes the module not available at the same path for my custom plugin as it is when the shipped InfluxDB plugin is built. I guess one answer would be to bundle a copy of the query_part module into my plugin, but is there a cleaner way to use the one Grafana already has and avoid duplication?

Hi, I’m getting the same error.
If you know how to solve it, could you please let me know?