feat(nx-dev): Add No_NEXT_PUBLIC_NO_INDEX environment variable (#26330)

Add no index env var
Preview / Dev now will have the `noindex` while the main / production
will be indexed
![Screenshot 2024-06-03 at 9 46
26 AM](https://github.com/nrwl/nx/assets/338948/f6f1d581-fdfa-44b6-8f43-24a3ddd4f4eb)
This commit is contained in:
Nicholas Cunningham 2024-06-03 09:49:02 -06:00 committed by GitHub
parent fbc88f2e6d
commit 8525bba7c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,4 @@
NEXT_PUBLIC_SEARCH_INDEX=nx-canary-production
NEXT_PUBLIC_SEARCH_API_KEY=07340b85db83fd49c1f904f883cc3ef8
NEXT_PUBLIC_SEARCH_APP_ID=PCTGM1JTQL
NEXT_PUBLIC_SEARCH_APP_ID=PCTGM1JTQL
NEXT_PUBLIC_NO_INDEX=false

View File

@ -46,6 +46,9 @@ export default function CustomApp({
site: '@nxdevtools',
cardType: 'summary_large_image',
}}
dangerouslySetAllPagesToNoIndex={
process.env.NEXT_PUBLIC_NO_INDEX === 'true'
}
/>
<Head>
<meta name="apple-mobile-web-app-title" content="Nx" />
@ -71,7 +74,7 @@ export default function CustomApp({
id="skip-to-content-link"
href="#main"
tabIndex={0}
className="absolute top-3 left-8 -translate-y-24 rounded-md bg-green-400 px-4 py-2 text-white transition focus:translate-y-0"
className="absolute left-8 top-3 -translate-y-24 rounded-md bg-green-400 px-4 py-2 text-white transition focus:translate-y-0"
>
Skip to content
</Link>