From fb94d8d3d4559a035d905fbd0f2d95509d866ffc Mon Sep 17 00:00:00 2001 From: Bee <68532117+abeatrix@users.noreply.github.com> Date: Fri, 19 Dec 2025 11:19:22 -0800 Subject: [PATCH] fix: expose process.platform in webview build configuration (#8201) * fix(webview): expose process.platform in build configuration Add process.platform to Vite and Storybook define configs to make platform detection available in the webview UI code. * Add changeset * Update webview-ui/vite.config.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * revert copilot suggestion * revert package-lock.json * remove unknown --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .changeset/fair-islands-throw.md | 5 +++++ webview-ui/.storybook/main.ts | 1 + webview-ui/vite.config.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/fair-islands-throw.md diff --git a/.changeset/fair-islands-throw.md b/.changeset/fair-islands-throw.md new file mode 100644 index 00000000..85c90205 --- /dev/null +++ b/.changeset/fair-islands-throw.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Fix issues where platform-based content was not displayed correctly. diff --git a/webview-ui/.storybook/main.ts b/webview-ui/.storybook/main.ts index 7169010c..e4ed9307 100644 --- a/webview-ui/.storybook/main.ts +++ b/webview-ui/.storybook/main.ts @@ -8,6 +8,7 @@ const config: StorybookConfig = { // Define environment variables for Storybook config.define = { ...config.define, + "process.platform": JSON.stringify(process?.platform), "process.env": { ...process.env, IS_DEV: JSON.stringify(true), diff --git a/webview-ui/vite.config.ts b/webview-ui/vite.config.ts index 234ee2f7..7b9e3097 100644 --- a/webview-ui/vite.config.ts +++ b/webview-ui/vite.config.ts @@ -113,6 +113,7 @@ export default defineConfig({ define: { __PLATFORM__: JSON.stringify(platform), process: JSON.stringify({ + platform: JSON.stringify(process?.platform), env: { NODE_ENV: JSON.stringify(process?.env?.IS_DEV ? "development" : "production"), CLINE_ENVIRONMENT: JSON.stringify(process?.env?.CLINE_ENVIRONMENT ?? "production"),