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

fix(nextjs): support workspace libs with standalone Next.js app #16471

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Apr 21, 2023

This PR fixes the setup when generating and using workspace libs in a Next.js standalone app.

  1. When @nx/next:lib is used, babel files should not be generated since we are using SWC.
  2. compilerOptions.paths: {} should not exist for standalone tsconfig.json, because migrating after generating lib will override the base paths in tsconfig.base.json file.

@vercel
Copy link

vercel bot commented Apr 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 8:14pm

@@ -152,14 +152,14 @@ describe('next library', () => {
expect(appTree.read('my-lib/src/index.ts', 'utf-8')).toContain(
'React client components'
);
expect(appTree.read('my-lib/src/server.ts', 'utf-8')).toContain(
expect(appTree.read('my-lib/src/server.tsx', 'utf-8')).toContain(
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to generate with a default component, otherwise the Standalone app complains about no exports being found from module.

@jaysoo jaysoo marked this pull request as ready for review April 21, 2023 19:28
@jaysoo jaysoo force-pushed the fix/nextjs-standalone-with-libs branch from 4c7093c to 0130b11 Compare April 21, 2023 20:00
@jaysoo jaysoo enabled auto-merge (squash) April 21, 2023 20:27
@jaysoo jaysoo merged commit bb11fe3 into nrwl:master Apr 21, 2023
@jaysoo jaysoo deleted the fix/nextjs-standalone-with-libs branch April 21, 2023 20:34
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants