-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve ESM output to support Deno, Bun and Edge runtimes (#29)
BREAKING CHANGE: Expanding ESM support is a significant change. Although a tremendous effort is made to preserve backward compatibility it can't be guaranteed as there are too many conditions, environments, and runtime versions to cover them all.
- Loading branch information
Showing
42 changed files
with
4,701 additions
and
11,800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// The EdgeRuntime check is to support dead-code elimination on Vercel Edge Functions: | ||
// https://edge-runtime.vercel.sh/features/available-apis#addressing-the-runtime | ||
if (typeof EdgeRuntime === 'string') { | ||
module.exports = require('./dist/sanityClient.browser.mjs') | ||
} else { | ||
module.exports = require('./lib/sanityClient.js') | ||
} |
Oops, something went wrong.