diff --git a/packages/common/env/src/global.ts b/packages/common/env/src/global.ts index 215a94824a..5699cc6e19 100644 --- a/packages/common/env/src/global.ts +++ b/packages/common/env/src/global.ts @@ -16,6 +16,7 @@ export const blockSuiteFeatureFlags = z.object({ export const runtimeFlagsSchema = z.object({ enablePlugin: z.boolean(), + builtinPlugins: z.array(z.string()), enableTestProperties: z.boolean(), enableBroadcastChannelProvider: z.boolean(), enableDebugPage: z.boolean(), diff --git a/packages/common/infra/src/__internal__/plugin.ts b/packages/common/infra/src/__internal__/plugin.ts index 4709df884d..9e2840939a 100644 --- a/packages/common/infra/src/__internal__/plugin.ts +++ b/packages/common/infra/src/__internal__/plugin.ts @@ -6,13 +6,7 @@ import type { z } from 'zod'; import type { packageJsonOutputSchema } from '../type.js'; -export const builtinPluginPaths = new Set([ - '/plugins/copilot', - '/plugins/hello-world', - '/plugins/image-preview', - '/plugins/vue-hello-world', - '/plugins/outline', -]); +export const builtinPluginPaths = new Set(runtimeConfig.builtinPlugins); const pluginCleanupMap = new Map void>>(); diff --git a/packages/frontend/core/.webpack/runtime-config.ts b/packages/frontend/core/.webpack/runtime-config.ts index 4a49aa041b..4347b706f8 100644 --- a/packages/frontend/core/.webpack/runtime-config.ts +++ b/packages/frontend/core/.webpack/runtime-config.ts @@ -17,6 +17,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig { const buildPreset: Record = { stable: { enablePlugin: true, + builtinPlugins: ['/plugins/image-preview'], enableTestProperties: false, enableBroadcastChannelProvider: true, enableDebugPage: true, @@ -52,6 +53,13 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig { // canary will be aggressive and enable all features canary: { enablePlugin: true, + builtinPlugins: [ + '/plugins/copilot', + '/plugins/hello-world', + '/plugins/image-preview', + '/plugins/vue-hello-world', + '/plugins/outline', + ], enableTestProperties: true, enableBroadcastChannelProvider: true, enableDebugPage: true, @@ -83,6 +91,13 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig { const currentBuildPreset = buildPreset[currentBuild]; const environmentPreset = { + builtinPlugins: [ + '/plugins/copilot', + '/plugins/hello-world', + '/plugins/image-preview', + '/plugins/vue-hello-world', + '/plugins/outline', + ], enablePlugin: process.env.ENABLE_PLUGIN ? process.env.ENABLE_PLUGIN === 'true' : currentBuildPreset.enablePlugin,