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 \ && yarn create nocobase-app my-nocobase-app -a \
-e APP_ENV=production \ -e APP_ENV=production \
-e PLUGIN_PACKAGE_PREFIX=@nocobase/plugin-,@nocobase/preset-,@nocobase/plugin-pro- \ -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 \ && cd /app/my-nocobase-app \
&& yarn install --production \ && yarn install --production \
&& yarn add @nocobase/plugin-pro-graph-collection-manager -W && yarn add @nocobase/plugin-pro-graph-collection-manager -W

View File

@ -1,28 +1,30 @@
import { Plugin } from '@nocobase/server'; import { Plugin } from '@nocobase/server';
import _ from 'lodash';
import path from 'path'; import path from 'path';
export class PresetNocoBase extends Plugin { export class PresetNocoBase extends Plugin {
getBuiltInPlugins() { getBuiltInPlugins() {
return process.env.PRESET_NOCOBASE_PLUGINS const plugins = (process.env.PRESET_NOCOBASE_PLUGINS || '').split(',').filter(Boolean);
? process.env.PRESET_NOCOBASE_PLUGINS.split(',') return _.uniq(
: [ [
'error-handler', 'error-handler',
'collection-manager', 'collection-manager',
'ui-schema-storage', 'ui-schema-storage',
'ui-routes-storage', 'ui-routes-storage',
'file-manager', 'file-manager',
'system-settings', 'system-settings',
'sequence-field', 'sequence-field',
'verification', 'verification',
'users', 'users',
'acl', 'acl',
'china-region', 'china-region',
'workflow', 'workflow',
'client', 'client',
'export', 'export',
'import', 'import',
'audit-logs', 'audit-logs',
]; ].concat(plugins),
);
} }
getLocalPlugins() { getLocalPlugins() {