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

moduleResolution nodenext #2124

Merged
merged 3 commits into from
Sep 21, 2024
Merged

moduleResolution nodenext #2124

merged 3 commits into from
Sep 21, 2024

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Sep 21, 2024

This updates the monorepo tsconfig to use module: nodenext, moduleResolution: nodenext.

Under this setting, typescript respect the Node's ideas about which files are CJS vs ESM. Most of our modules still compile to CJS, this PR isn't doing that conversion.

This PR does convert the @embroider/vite package to build as ESM, because vite itself makes it impossible to consume it's types from a CJS packge, and @embroider/vite's outbound deps aren't too bad. This does mean that when @embroider/vite imports from @embroider/core it needs to actually treat core as CJS, which is weird-looking but acceptable for now.

This updates the monorepo tsconfig to use module: nodenext, moduleResolution: nodenext.

Under this setting, typescript respect the Node's ideas about which files are CJS vs ESM. Most of our modules still compile to CJS, this PR isn't doing that conversion.

This PR does convert the `@embroider/vite` package to build as ESM, because vite itself makes it impossible to consume it's types from a CJS packge, and `@embroider/vite`'s outbound deps aren't too bad. This does mean that when `@embroider/vite` imports from `@embroider/core` it needs to actually treat core as CJS, which is weird-looking but acceptable for now.
@ef4 ef4 added the internal label Sep 21, 2024
@ef4 ef4 merged commit db5651b into main Sep 21, 2024
152 checks passed
@ef4 ef4 deleted the ts-module-resolution branch September 21, 2024 16:43
@github-actions github-actions bot mentioned this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant