@@ -29,7 +29,7 @@ import { getHandler } from '../templates/getHandler'
29
29
import { getResolverForPages , getResolverForSourceFiles } from '../templates/getPageResolver'
30
30
31
31
import { ApiConfig , extractConfigFromFile , isEdgeConfig } from './analysis'
32
- import { getBlobStorage } from './blobStorage'
32
+ import { getBlobStorage , isBlobStorageAvailable } from './blobStorage'
33
33
import { getRequiredServerFiles } from './config'
34
34
import { getDependenciesOfFile , getServerFile , getSourceFileForPage } from './files'
35
35
import { writeFunctionConfiguration } from './functionsMetaData'
@@ -469,11 +469,9 @@ type EnhancedNetlifyPluginConstants = NetlifyPluginConstants & {
469
469
export const getSSRLambdas = async ( {
470
470
publish,
471
471
constants,
472
- featureFlags,
473
472
} : {
474
473
publish : string
475
474
constants : EnhancedNetlifyPluginConstants
476
- featureFlags : Record < string , unknown >
477
475
} ) : Promise < SSRLambda [ ] > => {
478
476
const commonDependencies = await getCommonDependencies ( publish )
479
477
const ssrRoutes = await getSSRRoutes ( publish )
@@ -483,27 +481,19 @@ export const getSSRLambdas = async ({
483
481
const odbRoutes = ssrRoutes
484
482
const { NETLIFY_API_HOST , NETLIFY_API_TOKEN , SITE_ID } = constants
485
483
486
- console . dir ( featureFlags )
487
-
488
- // This check could be improved via featureFlags exposed in the build for blob storage
489
- const isUsingBlobStorage =
490
- destr ( featureFlags [ 'netlify-server-netliblob' ] ) &&
491
- destr ( featureFlags [ 'proxy-inject-netliblob-token' ] ) &&
492
- process . env . DEPLOY_ID !== '0' &&
493
- process . env . DEPLOY_ID !== undefined
484
+ const netliBlob = await getBlobStorage ( {
485
+ apiHost : NETLIFY_API_HOST ,
486
+ token : NETLIFY_API_TOKEN ,
487
+ siteID : SITE_ID ,
488
+ deployId : process . env . DEPLOY_ID ,
489
+ } )
494
490
495
491
const prerenderManifest = await getPrerenderManifest ( publish )
496
492
let ssrDependencies : Awaited < ReturnType < typeof getPrerenderedContent > >
497
493
498
- if ( isUsingBlobStorage ) {
494
+ if ( await isBlobStorageAvailable ( { deployId : process . env . DEPLOY_ID , netliBlob } ) ) {
499
495
console . log ( 'using blob storage' )
500
496
ssrDependencies = [ ]
501
- const netliBlob = await getBlobStorage ( {
502
- apiHost : NETLIFY_API_HOST ,
503
- token : NETLIFY_API_TOKEN ,
504
- siteID : SITE_ID ,
505
- deployId : process . env . DEPLOY_ID ,
506
- } )
507
497
508
498
try {
509
499
console . log ( 'warming up the cache with prerendered content' )
0 commit comments