How to access the /public folder from a plugin?

Pretty much what the title says.
I have utility functions in the public app folder that I would like all my plugins to have access to.

When I try:
import { myFunction } from 'app/foo/bar';

I get Cannot find module 'app/foo/bar' or its corresponding type declarations.

I also tried:

import { myFunction } from '/public/app/foo/bar';

import { myFunction } from '../../../../../public/app/foo/bar'; // relative to where my plugin is

import { myFunction } from 'grafana/app/foo/bar';

import { myFunction } from 'grafana/public/app/foo/bar';

None works.

I also tried to configure the plugin’s tsconfig.json to have public as a root dir, includes, and path, and nothing worked as well.

No answer, bumping the thread.
I would be ok with being answered with alternatives on how to share code between plugins, and how to access the redux store (since the store file is in public/app as well).

1 Like

Hey, I’m dealing with the same problem. I just created a topic on this. Any help would be appreciated. Thanks!

1 Like

Bump, still in need of an answer, and I’m not alone :slight_smile:

1 Like

Bump, need an answer…

Bump, need an answer