Skip to main content

$app/environment

import { const browser: boolean

true if the app is running in the browser.

browser
, const building: boolean

SvelteKit analyses your app during the build step by running it. During this process, building is true. This also applies during prerendering.

building
, const dev: boolean

Whether the dev server is running. This is not guaranteed to correspond to NODE_ENV or MODE.

dev
, const version: string

The value of config.kit.version.name.

version
} from '$app/environment';

浏览器

如果应用程序在浏览器中运行。

const 浏览器: boolean;

建筑

SvelteKit 在构建步骤中通过运行它来分析您的应用程序。在这个过程中,构建正在进行的true。这也适用于预渲染期间。

const building: boolean;

dev

是否开发服务器正在运行。这并不保证与 NODE_ENVMODE 相对应。

const dev: boolean;

版本

值 of config.kit.version.name.

const 版本:string;

Edit this page on GitHub llms.txt