Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proper exports field in package.json to be truly ESM compatible package #115

Open
RIP21 opened this issue Dec 30, 2024 · 0 comments
Open

Comments

@RIP21
Copy link

RIP21 commented Dec 30, 2024

Is your feature request related to a problem? Please describe.
In ESM you cannot import from the directory of the package. You can only import files described in exports mapping.

Describe the solution you'd like
Adding exports to package.json like that

  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.es.js",
      "require: "./dist/index.js",
      "default": "./dist/index.es.js"
    },
    "./dist/LiteYouTubeEmbed.css": "./dist/LiteYouTubeEmbed.css"
  },

Should likely do the trick.

More on that here https://nodejs.org/api/packages.html#conditional-exports

Describe alternatives you've considered
No alternatives. It's standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant