@@ -39,10 +39,11 @@ export interface ExportDetail {
39
39
}
40
40
41
41
export class PluginContext {
42
- utils : NetlifyPluginUtils
42
+ featureFlags : NetlifyPluginOptions [ 'featureFlags' ]
43
43
netlifyConfig : NetlifyPluginOptions [ 'netlifyConfig' ]
44
44
pluginName : string
45
45
pluginVersion : string
46
+ utils : NetlifyPluginUtils
46
47
47
48
private constants : NetlifyPluginConstants
48
49
private packageJSON : { name : string ; version : string } & Record < string , unknown >
@@ -152,6 +153,10 @@ export class PluginContext {
152
153
}
153
154
154
155
get useRegionalBlobs ( ) : boolean {
156
+ if ( ! ( this . featureFlags || { } ) [ 'next-runtime-regional-blobs' ] ) {
157
+ return false
158
+ }
159
+
155
160
// Region-aware blobs are only available as of CLI v17.23.5 (i.e. Build v29.41.5)
156
161
const REQUIRED_BUILD_VERSION = '>=29.41.5'
157
162
return satisfies ( this . buildVersion , REQUIRED_BUILD_VERSION , { includePrerelease : true } )
@@ -198,12 +203,13 @@ export class PluginContext {
198
203
}
199
204
200
205
constructor ( options : NetlifyPluginOptions ) {
206
+ this . constants = options . constants
207
+ this . featureFlags = options . featureFlags
208
+ this . netlifyConfig = options . netlifyConfig
201
209
this . packageJSON = JSON . parse ( readFileSync ( join ( PLUGIN_DIR , 'package.json' ) , 'utf-8' ) )
202
210
this . pluginName = this . packageJSON . name
203
211
this . pluginVersion = this . packageJSON . version
204
- this . constants = options . constants
205
212
this . utils = options . utils
206
- this . netlifyConfig = options . netlifyConfig
207
213
}
208
214
209
215
/** Resolves a path correctly with mono repository awareness for .netlify directories mainly */
0 commit comments