path to dependency

I'm working on a nuxt plugin to integrate a vue+tailwind components library.
for tailwindcss to work the files from that library need to be referenced in the generated config file.

I've had some success using:
export const resolvePackage = (pkg: string): string => new URL(import.meta.resolve(pkg)).pathname;


it it often explodes with an error I fail to understand:

ERROR  Error while importing module @poupe/nuxt: SyntaxError: Cannot use 'import.meta' outside a module                      


https://github.com/poupe-ui/poupe/blob/main/packages/poupe-nuxt/src/tailwind.ts#L13

any suggestion on how to get that path?
Was this page helpful?