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

adapter-vercel: Use CJS entrypoint to load ESM files #483

Merged
merged 7 commits into from
Mar 12, 2021

Conversation

GrygrFlzr
Copy link
Member

@GrygrFlzr GrygrFlzr commented Mar 11, 2021

  • Replace require() with await import()
  • Replace url.parse with new URL()
  • Use .mjs files for ESM with a single CJS index.js entrypoint

Replace require() with await import()
Replace url.parse with new URL()
@GrygrFlzr GrygrFlzr changed the title Vercel fixes adapter-vercel fixes Mar 11, 2021
@benmccann benmccann added bug Something isn't working adapters - general Support for functionality general to all adapters labels Mar 11, 2021
@@ -10,5 +10,5 @@ export default {
exports: 'default'
},
plugins: [nodeResolve(), commonjs()],
external: require('module').builtinModules
external: [...require('module').builtinModules, './server/app.js']
Copy link
Member

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?

Copy link
Member Author

@GrygrFlzr GrygrFlzr Mar 11, 2021

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.

@GrygrFlzr GrygrFlzr changed the title adapter-vercel fixes adapter-vercel: Use CJS entrypoint to load ESM files Mar 11, 2021
@Rich-Harris Rich-Harris merged commit d742029 into master Mar 12, 2021
@Rich-Harris Rich-Harris deleted the vercel-fixes branch March 12, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters - general Support for functionality general to all adapters bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants