-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
adapter-vercel: Use CJS entrypoint to load ESM files #483
Conversation
Replace require() with await import() Replace url.parse with new URL()
@@ -10,5 +10,5 @@ export default { | |||
exports: 'default' | |||
}, | |||
plugins: [nodeResolve(), commonjs()], | |||
external: require('module').builtinModules | |||
external: [...require('module').builtinModules, './server/app.js'] |
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.
does this need to use path.join
in order to work cross-platform?
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.
Nope, I built the adapter on Windows, and it properly recognizes it as an external dependency.
require()
withawait import()
url.parse
with newURL()
.mjs
files for ESM with a single CJSindex.js
entrypoint