refactor(dev): use Next.js externalDir
to fix dev app
#2631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the developer application after the TS refactor #2552
We rely on the experimental
externalDir
feature of Next.js found here: vercel/next.js#22867This basically means we can import
next-auth
source code - without needing to compile it first - into the dev server even if it lives outside of Next.js's root folder, and HMR will "just work".The only exception is the CSS which we use in Server-Side rendered pages that won't hot-reload anyway. They generate HTML through API routes, so no
getServerSideProps
is involved. This means editing the CSS won't trigger a manual page reload, but that has been the case before this PR as well.