From 90fc6291567bbf819898d16806c2a4e8ee987944 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 23 Apr 2024 14:21:27 -0700 Subject: [PATCH] Update define-constant.md --- docs/guides/runtime/define-constant.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/runtime/define-constant.md b/docs/guides/runtime/define-constant.md index e691cd4d79..6051bf30aa 100644 --- a/docs/guides/runtime/define-constant.md +++ b/docs/guides/runtime/define-constant.md @@ -69,6 +69,8 @@ To make all usages of `window` be `undefined`, you can use the following command bun --define window="undefined" src/index.ts ``` +--- + This can be useful when Server-Side Rendering (SSR) or when you want to make sure that the code doesn't depend on the `window` object. ```js @@ -91,8 +93,6 @@ bun --define global="globalThis" src/index.ts `global` is a global object in Node.js, but not in web browsers. So, you can use this to fix some cases where the code assumes that `global` is available. ---- - ### Replace values with JSON `--define` can also be used to replace values with JSON objects and arrays.