modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.15k stars 271 forks source link

@web/rollup-plugin-import-meta-assets: Types not part of the exports declaration in package.json #2737

Open woutervanvliet opened 1 month ago

woutervanvliet commented 1 month ago

When using @web/rollup-plugin-import-meta-assets in a type-checked file, TypeScript complains about the types not being available as they are not declared in the "export" key in package.json.

file.js:11:34 - error TS7016: Could not find a declaration file for module '@web/rollup-plugin-import-meta-assets'. '(..PATH..)/node_modules/@web/rollup-plugin-import-meta-assets/index.mjs' implicitly has an 'any' type.
  There are types at '(..PATH..)/node_modules/@web/rollup-plugin-import-meta-assets/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@web/rollup-plugin-import-meta-assets' library may need to update its package.json or typings.

11 import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets'