Skip to content

Frontend build fails resolving @ee imports when EE submodule is absent #9

@chenchenchenchencj

Description

@chenchenchenchencj

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:

  1. 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.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions