@@ -33,16 +33,19 @@ export default createPluginModule({
3333 pluginKey ,
3434 ) as StoragePluginDefinition ;
3535
36- // add feature providers
37- appCompiler . addChildrenToFeature ( storage . storageFeatureRef , {
38- storage : storageModuleGenerator ( {
39- s3Adapters : storage . s3Adapters . map ( ( a ) => ( {
40- name : a . name ,
41- bucketConfigVar : a . bucketConfigVar ,
42- hostedUrlConfigVar : a . hostedUrlConfigVar ,
43- } ) ) ,
44- } ) ,
45- } ) ;
36+ // add feature providers (only when file categories are configured,
37+ // since nearly all storage module templates depend on categories)
38+ if ( storage . fileCategories . length > 0 ) {
39+ appCompiler . addChildrenToFeature ( storage . storageFeatureRef , {
40+ storage : storageModuleGenerator ( {
41+ s3Adapters : storage . s3Adapters . map ( ( a ) => ( {
42+ name : a . name ,
43+ bucketConfigVar : a . bucketConfigVar ,
44+ hostedUrlConfigVar : a . hostedUrlConfigVar ,
45+ } ) ) ,
46+ } ) ,
47+ } ) ;
48+ }
4649
4750 // Collect file transformers with resolved categories
4851 const transformers = projectDefinition . models . flatMap ( ( m ) =>
@@ -146,7 +149,16 @@ export default createPluginModule({
146149 pluginAppCompiler ( {
147150 pluginKey,
148151 appType : webAppEntryType ,
149- compile : ( { appCompiler, appDefinition } ) => {
152+ compile : ( { appCompiler, appDefinition, projectDefinition } ) => {
153+ const webStorage = PluginUtils . configByKeyOrThrow (
154+ projectDefinition ,
155+ pluginKey ,
156+ ) as StoragePluginDefinition ;
157+
158+ if ( webStorage . fileCategories . length === 0 ) {
159+ return ;
160+ }
161+
150162 if (
151163 ! appDefinition . includeUploadComponents &&
152164 ! appDefinition . adminApp . enabled
0 commit comments