mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
8971e2feba
Adds electron-builder, which we will use to package and distribute our application, same as in the existing app. Replaces explicit port assignments with dynamic ones, which are then stored into environment variables. Adds a ~/.w2-dev folder for use when running a dev build. The build-helper pipeline from the old repo is included here too, but it is not updated yet so it will fail. Also removes some redundant utility functions and cleans up some let vs. const usage. The packaging can be run using the `package:prod` and `package:dev` tasks. --------- Co-authored-by: sawka <mike.sawka@gmail.com>
18 lines
599 B
TypeScript
18 lines
599 B
TypeScript
import { getEnv } from "./getenv";
|
|
import { lazy } from "./util";
|
|
|
|
export const WaveDevVarName = "WAVETERM_DEV";
|
|
export const WaveDevViteVarName = "WAVETERM_DEV_VITE";
|
|
|
|
/**
|
|
* Determines whether the current app instance is a development build.
|
|
* @returns True if the current app instance is a development build.
|
|
*/
|
|
export const isDev = lazy(() => !!getEnv(WaveDevVarName));
|
|
|
|
/**
|
|
* Determines whether the current app instance is running via the Vite dev server.
|
|
* @returns True if the app is running via the Vite dev server.
|
|
*/
|
|
export const isDevVite = lazy(() => !!getEnv(WaveDevViteVarName));
|