Skip to content

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

Merged
Rich-Harris merged 7 commits intomasterfrom
vercel-fixes
Mar 12, 2021
Merged

adapter-vercel: Use CJS entrypoint to load ESM files#483
Rich-Harris merged 7 commits intomasterfrom
vercel-fixes

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
},
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