-
-
Notifications
You must be signed in to change notification settings - Fork 127
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/server-esm #366
feat/server-esm #366
Conversation
86b4730
to
f7b5141
Compare
@@ -7,13 +7,20 @@ | |||
"lib": [ | |||
"ES2021", | |||
], | |||
// "module": "CommonJS", // Regular CJS output | |||
"module": "ESNext", | |||
"moduleResolution": "node16", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"moduleResolution": "node16", | |
"moduleResolution": "bundler", |
You might find that the bundler option works well here for your use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't I find any docs on how bundler
is different from node16
? Not even the TypeScript docs explain the new option:
https://www.typescriptlang.org/tsconfig#moduleResolution
Can you shed any light on how this will help this ESM effort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#moduleresolution-bundler
It allows you to optionally omit the file extension in imports but keep the other benefits of node16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#moduleresolution-bundler
Oh my god you have saved me so much time, thank you! 🤩
Edit: Tempering my enthusiasm a bit, bundler
might not be a silver bullet, but it's still worth looking into:
On the other hand, if you’re writing a library that’s meant to be published on npm, using the
bundler
option can hide compatibility issues that may arise for your users who aren’t using a bundler. So in these cases, using thenode16
ornodenext
resolution options is likely to be a better path.
Superseded by #425. |
Consider renaming deno directory to esm.
…On Mon, Aug 21, 2023 at 8:15 PM Matthew Miller ***@***.***> wrote:
Superseded by #425 <#425>
.
—
Reply to this email directly, view it on GitHub
<#366 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEVLYFWA2KURYSYIVDVVJDXWP2Z3ANCNFSM6AAAAAAVFF7HBA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This PR aims to add an ESM build to @simplewebauthn/server, alongside the existing CJS build.
Fixes #338.