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

refactor(dev): use Next.js externalDir to fix dev app #2631

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Aug 31, 2021

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#22867

This 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.

@vercel
Copy link

vercel bot commented Aug 31, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/AtLFtx6K7quxVYgbgTLVKn1fTJBM
✅ Preview: Failed

Copy link
Collaborator

@ubbe-xyz ubbe-xyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very neat 💯 💪🏽

Copy link
Member

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah awesome solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants