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

fix(correct-ts-specifiers): use module.registerHooks (for bundling) #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JakobJingleheimer
Copy link
Member

No description provided.

@JakobJingleheimer JakobJingleheimer force-pushed the fix/correct-ts-specifiers/alias-module-registerhooks branch from 7889cf7 to ae5bd7d Compare February 27, 2025 16:30
@JakobJingleheimer

This comment was marked as resolved.

@AugustinMauroy

This comment was marked as resolved.

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT

module.register('@nodejs-loaders/alias', import.meta.url);
import * as aliasLoader from '@nodejs-loaders/alias/alias.loader.mjs';

module.registerHooks(aliasLoader);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
module.registerHooks(aliasLoader);
// Registering sync hooks to resolve ts path alias
module.registerHooks(aliasLoader);

@JakobJingleheimer

This comment was marked as outdated.

@JakobJingleheimer JakobJingleheimer force-pushed the fix/correct-ts-specifiers/alias-module-registerhooks branch from ce913c7 to d89434c Compare February 27, 2025 21:58
@JakobJingleheimer
Copy link
Member Author

CI is failing on node 22.x because node:module.registerHooks hasn't been backported to 22.x yet: nodejs/node#57130

@JakobJingleheimer
Copy link
Member Author

Upstream fix to @types/node for type def: DefinitelyTyped/DefinitelyTyped#72122

@JakobJingleheimer
Copy link
Member Author

When manually published, this now works with the codemod executable 🥳 Thanks Mo!

@AugustinMauroy
Copy link
Member

Sweet !

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.

2 participants