Skip to content

feat: add support for use with next export #1012

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

Merged
merged 4 commits into from
Dec 16, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Dec 16, 2021

Summary

Currently the plugin fails the build if next export is used, which can be annoying for sites that have it auto-installed. This PR adds support for an env var NETLIFY_NEXT_PLUGIN_SKIP to disable everything except caching in the plugin. This can be set in a template or via the deploy button. It also supports setting NEXT_PLUGIN_FORCE_RUN to "false" for backward-compatibility with the old plugin.

This PR also adds a next export demo that uses this env var

Test plan

  1. Run NETLIFY_NEXT_PLUGIN_SKIP=1 ntl build
  2. Look for the warning

The netlify-plugin-nextjs-export-demo site has this set, so you can see the build status reported

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

#503

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-demo ready!

🔨 Explore the source changes: c71c52c

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/61bb4cca3073c100072447e6

😎 Browse the preview: https://deploy-preview-1012--netlify-plugin-nextjs-demo.netlify.app

@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

🔨 Explore the source changes: c71c52c

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/61bb4ccaa6b0bc0008863691

😎 Browse the preview: https://deploy-preview-1012--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app

@ascorbic ascorbic requested a review from tiffafoo December 16, 2021 12:46
@ascorbic ascorbic self-assigned this Dec 16, 2021
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Dec 16, 2021
@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

🔨 Explore the source changes: c71c52c

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/61bb4ccacc62f80008e9b3ea

😎 Browse the preview: https://deploy-preview-1012--netlify-plugin-nextjs-static-root-demo.netlify.app

@cypress
Copy link

cypress bot commented Dec 16, 2021



Test summary

2 0 0 0


Run details

Project netlify-plugin-nextjs-nx-monorepo-demo
Status Passed
Commit c71c52c
Started Dec 16, 2021 2:29 PM
Ended Dec 16, 2021 2:31 PM
Duration 01:10 💡
OS Linux Ubuntu - 20.04
Browser Custom chromium 90

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Dec 16, 2021



Test summary

16 0 0 0


Run details

Project netlify-plugin-nextjs-default-demo
Status Passed
Commit d114d26
Started Dec 16, 2021 1:26 PM
Ended Dec 16, 2021 1:29 PM
Duration 02:18 💡
OS Linux Ubuntu - 20.04
Browser Custom chromium 90

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link

cypress bot commented Dec 16, 2021



Test summary

7 0 0 0


Run details

Project netlify-plugin-nextjs-static-demo
Status Passed
Commit d114d26
Started Dec 16, 2021 1:28 PM
Ended Dec 16, 2021 1:29 PM
Duration 01:20 💡
OS Linux Ubuntu - 20.04
Browser Custom chromium 90

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for netlify-plugin-nextjs-export-demo ready!

🔨 Explore the source changes: c71c52c

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/61bb4cca43740b0007015ca4

😎 Browse the preview: https://deploy-preview-1012--netlify-plugin-nextjs-export-demo.netlify.app

@ascorbic
Copy link
Contributor Author

@tiffanosaurus Is there a way we can disable cypress in the "netlify-plugin-nextjs-skip-demo" site?

@ascorbic
Copy link
Contributor Author

...I've done it by creating a new demo

@ascorbic ascorbic changed the title feat: add support for env var to skip running plugin feat: add support for use with next export Dec 16, 2021
Copy link

@tiffafoo tiffafoo left a comment

Choose a reason for hiding this comment

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

🙆 Running ntl build with the env var set on the next-export demo shows the warning

@kodiakhq kodiakhq bot merged commit 76edc53 into main Dec 16, 2021
@kodiakhq kodiakhq bot deleted the mk/disable-plugin-env branch December 16, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants