$app/environment
import { const browser: booleantrue if the app is running in the browser.
browser, const building: booleanSvelteKit analyses your app during the build step by running it. During this process, building is true. This also applies during prerendering.
building, const dev: booleanWhether the dev server is running. This is not guaranteed to correspond to NODE_ENV or MODE.
dev, const version: stringThe value of config.kit.version.name.
version } from '$app/environment';browser
如果应用程序在浏览器中运行,则为 true。
const browser: boolean;building
SvelteKit 在 build 步骤中通过运行来分析您的应用程序。在此过程中,building 为 true。这也适用于预渲染过程。
const building: boolean;dev
表示开发服务端是否正在运行。这不能保证与 NODE_ENV 或 MODE 对应。
const dev: boolean;version
config.kit.version.name 的值。
const version: string;上一页 下一页