-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nextjs): Stop exporting the /api helpers based on the runtime
All of our helpers are isomorphic, so there's no need to check the runtime anymore.
- Loading branch information
1 parent
aa1421e
commit 224426a
Showing
2 changed files
with
1 addition
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
// TODO: Dynamic typings based on process | ||
export * from './dist/api'; |
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 |
---|---|---|
@@ -1,10 +1 @@ | ||
let exportLib; | ||
if (process.env.NEXT_RUNTIME === 'edge') { | ||
exportLib = require('./dist/edge-middleware'); | ||
exportLib.withAuth = exportLib.withEdgeMiddlewareAuth; | ||
exportLib.requireAuth = exportLib.requireEdgeMiddlewareAuth; | ||
} else { | ||
exportLib = require('./dist/api'); | ||
} | ||
|
||
module.exports = exportLib; | ||
module.exports = require('./dist/api'); |