Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

747 B
Raw Blame
export type StudioRuntimeMode = "development" | "production";

function readStudioImportMetaEnv(): ImportMetaEnv | undefined {
  try {
    return import.meta.env;
  } catch {
    return undefined;
  }
}

const studioImportMetaEnv = readStudioImportMetaEnv();

/**
 * Test hooks belong to Vite's development server, even when that server uses
 * production React for performance measurement. A production build has neither
 * DEV nor the development server mode, so the API stays out of shipped assets.
 */
export const STUDIO_RUNTIME_MODE: StudioRuntimeMode = studioImportMetaEnv?.DEV
  ? "development"
  : "production";

export const STUDIO_TEST_HOOKS_ENABLED =
  studioImportMetaEnv?.DEV === true || studioImportMetaEnv?.MODE === "development";