Skip to content

fix: type missing when set moduleResolution node16+#568

Merged
chenjiahan merged 1 commit intomainfrom
fix/types
Dec 17, 2024
Merged

fix: type missing when set moduleResolution node16+#568
chenjiahan merged 1 commit intomainfrom
fix/types

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

Summary

closes: #567

Fix cannot import typing issue when "moduleResolution": "NodeNext" in user's tsconfig.json by adding an empty package.json to the dist-types folder.

Related Links

web-infra-dev/rsbuild#2353

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link
Copy Markdown
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json should be updated too

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 17, 2024

CodSpeed Performance Report

Merging #568 will not alter performance

Comparing fix/types (1c9d239) with main (0f71812)

Summary

✅ 5 untouched benchmarks

@Timeless0911
Copy link
Copy Markdown
Contributor Author

package.json should be updated too

  "exports": {
    ".": {
      "types": "./dist-types/index.d.ts",
      "default": "./dist/index.js"
    },
    "./package.json": "./package.json"
  },
  "main": "./dist/index.js",
  "types": "./dist-types/index.d.ts",

Already correct I think.

@chenjiahan chenjiahan merged commit 3d5312d into main Dec 17, 2024
@chenjiahan chenjiahan deleted the fix/types branch December 17, 2024 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot import typings from @rslib/core

2 participants