jankapunkt / npm-package-template

:package: minimal NPM package template using Babel, Mocha, Chai, C8, Standardjs, JSDoc and Rollup.
https://jankapunkt.github.io/npm-package-template/
MIT License
17 stars 8 forks source link

Fix default entry points #42

Open jankapunkt opened 1 year ago

jankapunkt commented 1 year ago

Describe the bug

The default entry points are not 100% working in all environments plus some popular ones are missing

To Reproduce Import a package using recent vite build system

Expected behavior should import

Additional context

It should be the following:

{
  "type": "module",
  "main": "dist/index.cjs.js",
  "browser": "dist/index.iife.js",
  "exports": {
    "import": "./dist/index.js",
    "require": "./dist/index.cjs.js"
  },
  "module": "dist/index.js",
  "unpkg": "dist/index.iife.js",
  "jsdelivr": "dist/index.iife.js",
  "types": "dist/index.d.ts",
}

Note that types are missing, too and require #41 to be implemented