File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ The `PluginContext` class (`src/build/plugin-context.ts`) centralizes build conf
70
70
71
71
### Skew Protection
72
72
73
- When ` VERCEL_SKEW_PROTECTION_ENABLED =1` is set, the plugin automatically:
73
+ When ` NEXT_SKEW_PROTECTION_ENABLED =1` is set, the plugin automatically:
74
74
75
75
1 . ** Sets deployment ID** : Maps ` NETLIFY_DEPLOY_ID ` to ` VERCEL_DEPLOYMENT_ID ` for Next.js compatibility
76
76
2 . ** Creates edge function** : Generates a skew protection edge function at ` ___netlify-skew-protection `
@@ -105,7 +105,7 @@ Extensive test fixtures cover scenarios like:
105
105
- ` NETLIFY_NEXT_PLUGIN_SKIP ` - Skip plugin execution entirely
106
106
- ` NEXT_PRIVATE_STANDALONE ` - Enabled automatically for builds
107
107
- ` IS_LOCAL ` - Indicates local development vs deployment
108
- - ` VERCEL_SKEW_PROTECTION_ENABLED ` - Enable Next.js skew protection (set to '1')
108
+ - ` NEXT_SKEW_PROTECTION_ENABLED ` - Enable Next.js skew protection (set to '1')
109
109
- ` VERCEL_DEPLOYMENT_ID ` - Set automatically from ` NETLIFY_DEPLOY_ID ` when skew protection is enabled
110
110
111
111
## Build Tools
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ export const createEdgeHandlers = async (ctx: PluginContext) => {
214
214
const edgeHandlerPromises = nextDefinitions . map ( ( def ) => createEdgeHandler ( ctx , def ) )
215
215
216
216
// Create skew protection handler if enabled
217
- if ( process . env . VERCEL_SKEW_PROTECTION_ENABLED === '1' ) {
217
+ if ( process . env . NEXT_SKEW_PROTECTION_ENABLED === '1' ) {
218
218
edgeHandlerPromises . push ( createSkewProtectionHandler ( ctx ) )
219
219
}
220
220
@@ -223,7 +223,7 @@ export const createEdgeHandlers = async (ctx: PluginContext) => {
223
223
const netlifyDefinitions = nextDefinitions . flatMap ( ( def ) => buildHandlerDefinition ( ctx , def ) )
224
224
225
225
// Add skew protection handler to manifest if enabled
226
- if ( process . env . VERCEL_SKEW_PROTECTION_ENABLED === '1' ) {
226
+ if ( process . env . NEXT_SKEW_PROTECTION_ENABLED === '1' ) {
227
227
const skewProtectionDefinition : ManifestFunction = {
228
228
function : SKEW_PROTECTION_HANDLER_NAME ,
229
229
name : 'Next.js Skew Protection Handler' ,
Original file line number Diff line number Diff line change @@ -54,14 +54,14 @@ export const onPreBuild = async (options: NetlifyPluginOptions) => {
54
54
process . env . NEXT_PRIVATE_STANDALONE = 'true'
55
55
56
56
// Set up skew protection if enabled
57
- if ( process . env . VERCEL_SKEW_PROTECTION_ENABLED === '1' ) {
57
+ if ( process . env . NEXT_SKEW_PROTECTION_ENABLED === '1' ) {
58
58
// Use Netlify's deploy ID as the deployment ID for Next.js
59
59
const deployId = process . env . NETLIFY_DEPLOY_ID
60
60
if ( deployId ) {
61
61
process . env . VERCEL_DEPLOYMENT_ID = deployId
62
62
console . log ( '[Skew Protection] Enabled with deployment ID:' , deployId )
63
63
} else {
64
- console . warn ( '[Skew Protection] VERCEL_SKEW_PROTECTION_ENABLED is set but NETLIFY_DEPLOY_ID is not available' )
64
+ console . warn ( '[Skew Protection] NEXT_SKEW_PROTECTION_ENABLED is set but NETLIFY_DEPLOY_ID is not available' )
65
65
}
66
66
}
67
67
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ describe('skew protection', () => {
9
9
ctx = new FixtureTestContext ( {
10
10
name : 'skew-protection' ,
11
11
env : {
12
- VERCEL_SKEW_PROTECTION_ENABLED : '1' ,
12
+ NEXT_SKEW_PROTECTION_ENABLED : '1' ,
13
13
NETLIFY_DEPLOY_ID : 'test-deploy-123' ,
14
14
} ,
15
15
} )
You can’t perform that action at this time.
0 commit comments