-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Expose contents of @sveltejs/app-utils
as CJS as well as ESM
#592
Comments
An alternative is to put those utils into the Based on how things are right now, if we had a |
Right, this makes a lot of sense. In that case that's probably the refactor I need to do! I'll have a crack later unless somebody beats me to it. |
Opening this for feedback before I go ahead and add the build step, but it looks like we can't use commonjs in adapters and then depend on esm modules such as
@sveltejs/app-utils
if we expect anything to work.This sort of thing:
relies on the exports map present in
@sveltejs/app-utils
:However this needs to be modified to allow
require
to access these exports too:This then causes the following error:
So it looks like we need to build app-utils for
cjs
andesm
in order that it can be used with both types of module.Happy to go ahead and do this and then fix the
vercel
andbegin
adapters accordingly if I'm not missing something.The text was updated successfully, but these errors were encountered: