@@ -39,10 +39,11 @@ export interface ExportDetail {
3939}
4040
4141export class PluginContext {
42- utils : NetlifyPluginUtils
42+ featureFlags : NetlifyPluginOptions [ 'featureFlags' ]
4343 netlifyConfig : NetlifyPluginOptions [ 'netlifyConfig' ]
4444 pluginName : string
4545 pluginVersion : string
46+ utils : NetlifyPluginUtils
4647
4748 private constants : NetlifyPluginConstants
4849 private packageJSON : { name : string ; version : string } & Record < string , unknown >
@@ -152,6 +153,10 @@ export class PluginContext {
152153 }
153154
154155 get useRegionalBlobs ( ) : boolean {
156+ if ( ! ( this . featureFlags || { } ) [ 'next-runtime-regional-blobs' ] ) {
157+ return false
158+ }
159+
155160 // Region-aware blobs are only available as of CLI v17.23.5 (i.e. Build v29.41.5)
156161 const REQUIRED_BUILD_VERSION = '>=29.41.5'
157162 return satisfies ( this . buildVersion , REQUIRED_BUILD_VERSION , { includePrerelease : true } )
@@ -198,12 +203,13 @@ export class PluginContext {
198203 }
199204
200205 constructor ( options : NetlifyPluginOptions ) {
206+ this . constants = options . constants
207+ this . featureFlags = options . featureFlags
208+ this . netlifyConfig = options . netlifyConfig
201209 this . packageJSON = JSON . parse ( readFileSync ( join ( PLUGIN_DIR , 'package.json' ) , 'utf-8' ) )
202210 this . pluginName = this . packageJSON . name
203211 this . pluginVersion = this . packageJSON . version
204- this . constants = options . constants
205212 this . utils = options . utils
206- this . netlifyConfig = options . netlifyConfig
207213 }
208214
209215 /** Resolves a path correctly with mono repository awareness for .netlify directories mainly */
0 commit comments