XiongAmao / vue-easy-lightbox

A tiny lightbox component for Vue.js 3.0 :tada::tada: https://xiongamao.github.io/vue-easy-lightbox/
MIT License
420 stars 69 forks source link

Support "types" condition in "exports" field #127

Closed sheremet-va closed 1 year ago

sheremet-va commented 1 year ago

TypeScript with moduleResolution: "bundler" or module: "node16" only looks at "types" condition in exports field. If there is no types field there as the first option, it will fail. You can see all the errors here: https://arethetypeswrong.github.io

Documentation: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html

Proposed fix:

// package.json
{
  "exports": {
    ".": {
      "types": "./types/index.d.ts",
      "import": "./dist/vue-easy-lightbox.esm.min.js",
      "require": "./dist/vue-easy-lightbox.common.min.js",
      "browser": "./dist/vue-easy-lightbox.umd.min.js"
    },
    "./external-css": {
      "types": "./types/index.d.ts",
      "import": "./dist/external-css/vue-easy-lightbox.esm.min.js",
      "require": "./dist/external-css/vue-easy-lightbox.common.min.js",
      "browser": "./dist/external-css/vue-easy-lightbox.umd.min.js"
    },
    "./external-css/vue-easy-lightbox.css": "./dist/external-css/vue-easy-lightbox.css",
    "./*": "./*"
  },
}
XiongAmao commented 1 year ago

Hi, i have released these change in v1.15.0.