magic-akari / seamless-scroll-polyfill

Scroll Behavior polyfill
https://www.npmjs.com/package/seamless-scroll-polyfill
MIT License
159 stars 11 forks source link

Types break with moduleResolution NodeNext in tsconfig.json #144

Closed unshame closed 1 year ago

unshame commented 1 year ago

With "moduleResolution": "NodeNext" in tsconfig.json, typescript fails to find type definitions for seamless-scroll-polyfill.

This is caused by the following issues:

  1. Lack of "types": "./lib/index.d.ts" under exports in package.json. Typescript ignores the root "types" in this mode.
  2. Type imports without file extension in source code and compiled code, i.e. https://github.com/magic-akari/seamless-scroll-polyfill/blob/master/src/scroll.ts#L11 Since this package is specified as "type": "module" in package.json, typescript uses esm path resolution in this mode.
github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

magic-akari commented 1 year ago

There is still an issue with the "moduleResolution": "NodeNext" and "type":"commonjs" option.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: