fix: process.env.PRESET_NOCOBASE_PLUGINS

This commit is contained in:
chenos 2022-12-18 23:27:03 +08:00
parent 6d11e23700
commit e481c2b59b
2 changed files with 23 additions and 21 deletions

View File

@ -34,7 +34,7 @@ RUN cd /app \
&& yarn create nocobase-app my-nocobase-app -a \
-e APP_ENV=production \
-e PLUGIN_PACKAGE_PREFIX=@nocobase/plugin-,@nocobase/preset-,@nocobase/plugin-pro- \
-e PRESET_NOCOBASE_PLUGINS=error-handler,collection-manager,ui-schema-storage,ui-routes-storage,file-manager,system-settings,verification,users,acl,china-region,workflow,client,export,import,sequence-field,audit-logs,graph-collection-manager \
-e PRESET_NOCOBASE_PLUGINS=graph-collection-manager \
&& cd /app/my-nocobase-app \
&& yarn install --production \
&& yarn add @nocobase/plugin-pro-graph-collection-manager -W

View File

@ -1,11 +1,12 @@
import { Plugin } from '@nocobase/server';
import _ from 'lodash';
import path from 'path';
export class PresetNocoBase extends Plugin {
getBuiltInPlugins() {
return process.env.PRESET_NOCOBASE_PLUGINS
? process.env.PRESET_NOCOBASE_PLUGINS.split(',')
: [
const plugins = (process.env.PRESET_NOCOBASE_PLUGINS || '').split(',').filter(Boolean);
return _.uniq(
[
'error-handler',
'collection-manager',
'ui-schema-storage',
@ -22,7 +23,8 @@ export class PresetNocoBase extends Plugin {
'export',
'import',
'audit-logs',
];
].concat(plugins),
);
}
getLocalPlugins() {