From 1f969738f58576879f89515896ce213287d0259c Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Wed, 25 Feb 2026 14:31:05 +0800 Subject: [PATCH] docs: add Windows .env file note for VITE_IS_TELEGRAM (#844) --- vitepress-docs/docs/en/guide/feature/telegram.md | 8 ++++++++ vitepress-docs/docs/zh/guide/feature/telegram.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/vitepress-docs/docs/en/guide/feature/telegram.md b/vitepress-docs/docs/en/guide/feature/telegram.md index 1cc6d4f8..823419e5 100644 --- a/vitepress-docs/docs/en/guide/feature/telegram.md +++ b/vitepress-docs/docs/en/guide/feature/telegram.md @@ -76,10 +76,18 @@ For other steps, refer to `Frontend and Backend Separation Deployment` in [UI De cd frontend pnpm install cp .env.example .env.prod +# Edit .env.prod and set VITE_IS_TELEGRAM=true # --project-name can create a separate pages for mini app, you can also share one pages, but may encounter js loading issues pnpm run deploy:telegram --project-name= ``` +> [!WARNING] +> Windows users: The inline `VITE_IS_TELEGRAM=true` environment variable in npm scripts does not work on Windows. +> Please set `VITE_IS_TELEGRAM=true` in your `.env.prod` file manually, then use the regular build command instead: +> ```bash +> pnpm run build +> ``` + - After deployment, please fill in the web URL in the `Settings` -> `Telegram Mini App` page `Telegram Mini App URL` in the admin backend. - Please execute `/setmenubutton` in `@BotFather`, then enter your web address to set the `Open App` button in the lower left corner. - Please execute `/newapp` in `@BotFather` to create a new app and register the mini app. diff --git a/vitepress-docs/docs/zh/guide/feature/telegram.md b/vitepress-docs/docs/zh/guide/feature/telegram.md index 0a8db782..9d1a75a8 100644 --- a/vitepress-docs/docs/zh/guide/feature/telegram.md +++ b/vitepress-docs/docs/zh/guide/feature/telegram.md @@ -76,10 +76,18 @@ Telegram Bot 支持中英文切换,用户可以通过 `/lang` 命令设置语 cd frontend pnpm install cp .env.example .env.prod +# 修改 .env.prod 文件,设置 VITE_IS_TELEGRAM=true # --project-name 可以单独为 mini app 创建一个 pages, 你也可以公用一个 pages,但是可能遇到 js 加载不了的问题 pnpm run deploy:telegram --project-name=<你的项目名称> ``` +> [!WARNING] +> Windows 用户请注意:`npm scripts` 中的 `VITE_IS_TELEGRAM=true` 内联环境变量写法在 Windows 上不生效。 +> 请在 `.env.prod` 文件中手动设置 `VITE_IS_TELEGRAM=true`,然后使用普通的 build 命令代替: +> ```bash +> pnpm run build +> ``` + - 部署完成后,请在 admin 后台的 `设置` -> `电报小程序` 页面 `电报小程序 URL` 中填写网页 URL。 - 请在 `@BotFather` 处执行 `/setmenubutton`,然后输入你的网页地址,设置左下角的 `Open App` 按钮。 - 请在 `@BotFather` 处执行 `/newapp` 新建 app 来注册 mini app。