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