Problem
When building the frontend without the EE submodule, the Vite/Rollup build fails with unresolved import errors:
[vite]: Rollup failed to resolve import "@ee/components/SsoConfigPanel.vue" from "src/views/SettingsView.vue"
Root Cause
Two issues in frontend/vite.config.ts:
-
Inaccurate EE detection: existsSync(eeDir) returns true for an empty directory (created by the Dockerfile context stage), causing __EE__ to be set to true even when no EE code is present.
-
No stub for @EE imports: Even when __EE__ is correctly false, Rollup still tries to resolve all import('@ee/...') expressions during its resolution phase (before tree-shaking removes the dead code branches). Without a way to resolve these imports, the build fails.
Expected Behavior
npm run build should succeed when the EE submodule is not initialized, with all @ee imports safely stubbed out and eliminated by tree-shaking.
Problem
When building the frontend without the EE submodule, the Vite/Rollup build fails with unresolved import errors:
Root Cause
Two issues in
frontend/vite.config.ts:Inaccurate EE detection:
existsSync(eeDir)returnstruefor an empty directory (created by the Dockerfile context stage), causing__EE__to be set totrueeven when no EE code is present.No stub for @EE imports: Even when
__EE__is correctlyfalse, Rollup still tries to resolve allimport('@ee/...')expressions during its resolution phase (before tree-shaking removes the dead code branches). Without a way to resolve these imports, the build fails.Expected Behavior
npm run buildshould succeed when the EE submodule is not initialized, with all@eeimports safely stubbed out and eliminated by tree-shaking.