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

feat: experimental isolated declaration support #411

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jul 2, 2024

Add experimental support for isolated declaration generation powered by OXC and unplugin-isolated-decl by @sxzz ❤️

Read more: microsoft/TypeScript#58944

To opt in:

import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
  rollup: {
    // https://github.com/microsoft/TypeScript/issues/58944
    // https://github.com/unplugin/unplugin-isolated-decl
    isolatedDecl: {
      transformer: "oxc",
    },
  },
});

Tips for migrating the codebase to be ready for isolated declaration support:

TODO

Currently plugin generates types to dist/src/**.{mts,cts}. We need to find a way to merge them or at least generate top level declaration in dist/*.{mts,dts} to make it cleaner for package.json exports and avoid requirement of updating it. Also the paths seem relative to root in tsconfig rather than dist!

@pi0 pi0 self-assigned this Jul 2, 2024
@pi0 pi0 marked this pull request as draft July 2, 2024 12:11
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

Successfully merging this pull request may close these issues.

1 participant