@@ -14,10 +14,14 @@ import { installDependencies } from "@opennextjs/aws/build/installDeps.js";
1414import type { CodePatcher } from "@opennextjs/aws/build/patch/codePatcher.js" ;
1515import { applyCodePatches } from "@opennextjs/aws/build/patch/codePatcher.js" ;
1616import {
17+ patchEnvVars ,
1718 patchFetchCacheForISR ,
1819 patchFetchCacheSetMissingWaitUntil ,
20+ patchNextServer ,
1921 patchUnstableCacheForISR ,
2022} from "@opennextjs/aws/build/patch/patches/index.js" ;
23+ // TODO: import from patches/index.js when https://github.com/opennextjs/opennextjs-aws/pull/827 is released
24+ import { patchBackgroundRevalidation } from "@opennextjs/aws/build/patch/patches/patchBackgroundRevalidation.js" ;
2125import logger from "@opennextjs/aws/logger.js" ;
2226import { minifyAll } from "@opennextjs/aws/minimize-js.js" ;
2327import type { ContentUpdater } from "@opennextjs/aws/plugins/content-updater.js" ;
@@ -190,6 +194,9 @@ async function generateBundle(
190194 patchFetchCacheSetMissingWaitUntil ,
191195 patchFetchCacheForISR ,
192196 patchUnstableCacheForISR ,
197+ patchNextServer ,
198+ patchEnvVars ,
199+ patchBackgroundRevalidation ,
193200 // Cloudflare specific patches
194201 patchResRevalidate ,
195202 ...additionalCodePatches ,
@@ -220,6 +227,7 @@ async function generateBundle(
220227 ...( disableNextPrebundledReact ? [ "applyNextjsPrebundledReact" ] : [ ] ) ,
221228 ...( disableRouting ? [ "withRouting" ] : [ ] ) ,
222229 ...( isAfter142 ? [ "patchAsyncStorage" ] : [ ] ) ,
230+ ...( isAfter141 ? [ "appendPrefetch" ] : [ ] ) ,
223231 ] ,
224232 } ) ,
225233 openNextReplacementPlugin ( {
0 commit comments