When importing vite-plugin-target in a project with "moduleResolution": "Bundler" or "moduleResolution": "NodeNext", typescript cannot resolve the .d.ts provided by vite-plugin-target with the following error:
error TS7016: Could not find a declaration file for module 'vite-plugin-target'. '<...>/node_modules/.pnpm/vite-plugin-target@0.1.1/node_modules/vite-plugin-target/index.mjs' implicitly has an 'any' type.
There are types at '<...>/node_modules/vite-plugin-target/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vite-plugin-target' library may need to update its package.json or typings.
Despite declaring root-level "types" in package.json, it should also be declared in package.json "exports".
When importing vite-plugin-target in a project with
"moduleResolution": "Bundler"
or"moduleResolution": "NodeNext"
, typescript cannot resolve the .d.ts provided by vite-plugin-target with the following error:Despite declaring root-level "types" in package.json, it should also be declared in package.json "exports".