-
Notifications
You must be signed in to change notification settings - Fork 89
chore: rearrange plugin wrapper #1668
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
Conversation
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-hp-edge-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-rsc-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
633b6b0
to
f7be133
Compare
f7be133
to
941c67a
Compare
Summary
Currently we use a local plugin
plugin-wrapper
which re-exports the runtime package, to ensure that@netlify/build
doesn't error out when the runtime hasn't been built yet. The problem is that because the wrapper isn't called@netlify/plugin-nextjs
, the CLI attempts to auto-install the runtime, leading to errors from double installs. The same problem occurs when running demo sites locally.This PR changes the demo sites to specify the runtime package as
@netlify/plugin-nextjs
. This is correctly resolved in the monorepo so that it loads the local version. However we still need to work around the need to compile the runtime. The wrokaround here is two-fold. First we change the entrypoint in the runtime from the compiledlib/index.js
, to a static file in the rootindex.js
which re-exportslib/index.js
. This means that when build starts, it is able to resolve the entrypoint file and not throw an error. We keep theplugin-wrapper
plugin, but make it empty and just use it to ensure thatnpm install
is run, which in turn builds the runtime.Test plan
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.