Skip to content

Commit cd60499

Browse files
committed
fix: refactor plugin initialization for conditional MSW usage and enhance plugin configuration
1 parent 32ebe60 commit cd60499

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

apps/console/objectstack.config.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ const DummyApiRegistryPlugin = {
9696
}
9797
};
9898

99+
const plugins: any[] = [
100+
new ObjectQLPlugin(),
101+
// new PatchedMSWPlugin(), // Disabled in production mode as per requirement
102+
new PatchedHonoServerPlugin({
103+
staticRoot: './dist'
104+
}),
105+
FixedConsolePlugin,
106+
DummyApiRegistryPlugin
107+
];
108+
109+
// Re-enable MSW only if explicitly needed (e.g. via test env var, though technically pnpm dev uses browser MSW)
110+
if (process.env.ENABLE_MSW_PLUGIN === 'true') {
111+
plugins.push(new PatchedMSWPlugin());
112+
}
113+
99114
export default defineConfig({
100115
// ============================================================================
101116
// Project Metadata
@@ -130,13 +145,7 @@ export default defineConfig({
130145
// Plugin Configuration
131146
// ============================================================================
132147

133-
plugins: [
134-
new ObjectQLPlugin(),
135-
new PatchedMSWPlugin(),
136-
new PatchedHonoServerPlugin(),
137-
FixedConsolePlugin,
138-
DummyApiRegistryPlugin
139-
],
148+
plugins,
140149

141150
// ============================================================================
142151
// Merged Stack Configuration (CRM + Todo + Kitchen Sink + Mock Metadata)

0 commit comments

Comments
 (0)