Skip to content

[Feature] Split Build Modes for Tool and Library GUI #99

@haerim-kweon

Description

@haerim-kweon

feature request

TODO

  • Separate build processes for tool and library GUI.

  • Create separate Vite configuration files for each mode.

  • When building in tool mode, include all files.

  • When building in library mode:

    • Exclude the loadtest folder from the build.
    • Hide the load test icon from the navigation UI.
    • Prevent routing access to load test paths.
  • Use .env files to manage build mode (VITE_BUILD_MODE=tool or lib).

  • Split shared files (e.g., routes) into two variants (routes.tool.ts, routes.lib.ts) and dynamically import/export based on mode.

  • Add vite.tool.config.ts and vite.lib.config.ts files for each mode.

  • Update package.json with:

    "scripts": {
      "build:tool": "vite build --mode tool --config vite.tool.config.ts",
      "build:lib": "vite build --mode lib --config vite.lib.config.ts"
    }
    

Describe Solution

We want to maintain separate behavior and features depending on whether the GUI is being built for internal tool usage or as a library version for distribution.

This requires:

  • Mode-specific Vite configuration files that optimize or exclude certain features.
  • Shared configuration elements (like ROUTES) need to be modularized into separate files per mode, then conditionally exported depending on VITE_BUILD_MODE.
  • Navigation and routing should be dynamically adapted so that in library mode, internal/testing-specific components (like load testing) are not visible or accessible.

Additional Info

  • Example .env files:

    • .env.toolVITE_BUILD_MODE=tool
    • .env.libVITE_BUILD_MODE=lib
  • Helps prevent accidental exposure of internal tools in distributed library builds.

  • Improves modularity, maintainability, and clarity in build pipeline.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions