fix: environment variables (#1490)
This commit is contained in:
		
							parent
							
								
									856b6efa77
								
							
						
					
					
						commit
						b91937552c
					
				| @ -3,10 +3,7 @@ import _ from 'lodash'; | ||||
| import path from 'path'; | ||||
| 
 | ||||
| export class PresetNocoBase extends Plugin { | ||||
|   getBuiltInPlugins() { | ||||
|     const plugins = (process.env.PRESET_NOCOBASE_PLUGINS || '').split(',').filter(Boolean); | ||||
|     return _.uniq( | ||||
|       [ | ||||
|   builtInPlugins = [ | ||||
|     'error-handler', | ||||
|     'collection-manager', | ||||
|     'ui-schema-storage', | ||||
| @ -26,12 +23,9 @@ export class PresetNocoBase extends Plugin { | ||||
|     'duplicator', | ||||
|     'iframe-block', | ||||
|     'formula-field', | ||||
|       ].concat(plugins), | ||||
|     ); | ||||
|   } | ||||
|   ]; | ||||
| 
 | ||||
|   getLocalPlugins() { | ||||
|     const localPlugins = [ | ||||
|   localPlugins = [ | ||||
|     'sample-hello', | ||||
|     'multi-app-manager', | ||||
|     'oidc', | ||||
| @ -40,7 +34,21 @@ export class PresetNocoBase extends Plugin { | ||||
|     'snapshot-field', | ||||
|     'graph-collection-manager', | ||||
|   ]; | ||||
|     return localPlugins; | ||||
| 
 | ||||
|   splitNames(name: string) { | ||||
|     return (name || '').split(',').filter(Boolean); | ||||
|   } | ||||
| 
 | ||||
|   getBuiltInPlugins() { | ||||
|     const { PRESET_NOCOBASE_PLUGINS, APPEND_PRESET_BUILT_IN_PLUGINS } = process.env; | ||||
|     return _.uniq( | ||||
|       this.splitNames(APPEND_PRESET_BUILT_IN_PLUGINS || PRESET_NOCOBASE_PLUGINS).concat(this.builtInPlugins), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   getLocalPlugins() { | ||||
|     const { APPEND_PRESET_LOCAL_PLUGINS } = process.env; | ||||
|     return _.uniq(this.splitNames(APPEND_PRESET_LOCAL_PLUGINS).concat(this.localPlugins)); | ||||
|   } | ||||
| 
 | ||||
|   async addBuiltInPlugins(options?: any) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user