Skip to content

Commit 6145071

Browse files
committed
docs: fix build by moving constants to a separate file and avoid bundler crash (backport)
1 parent d8eb80d commit 6145071

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { defineConfig } from "vitepress";
33
// @ts-ignore: linting before typedoc is generated will throw an error here
44
import typedocSidebar from "../api/typedoc-sidebar.json";
55
import { fullVersion, majorVersion, majorNumber } from "./version";
6-
7-
const isProd = process.env.NODE_ENV === "production";
8-
const siteUrl = "https://cooklang-parser.tmlmt.com";
6+
import { isProd, siteUrl } from "./constants";
97

108
// https://vitepress.dev/reference/site-config
119
export default defineConfig({

docs/.vitepress/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const isProd = process.env.NODE_ENV === "production";
2+
export const siteUrl = "https://cooklang-parser.tmlmt.com";

docs/.vitepress/theme/Layout.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import DefaultTheme from "vitepress/theme";
33
import { isPrerelease, majorVersion } from "../version";
4+
import { isProd, siteUrl } from "../constants";
45
56
const { Layout } = DefaultTheme;
67
</script>

0 commit comments

Comments
 (0)