diff --git a/app/docs/.env b/app/docs/.env new file mode 100644 index 0000000000..8bece7144a --- /dev/null +++ b/app/docs/.env @@ -0,0 +1,2 @@ +DEV_HOST=localhost +DEV_PORT=5173 diff --git a/app/docs/BUCK b/app/docs/BUCK index 800573fc87..99b208b0eb 100644 --- a/app/docs/BUCK +++ b/app/docs/BUCK @@ -20,7 +20,7 @@ load( pnpm_task_binary( name = "dev", - command = "docs:dev", + command = "dev", srcs = glob(["src/**/*"]), path = "app/docs", deps = [ diff --git a/app/docs/package.json b/app/docs/package.json index d4b1fc0ef5..a2ef94b34a 100644 --- a/app/docs/package.json +++ b/app/docs/package.json @@ -4,7 +4,8 @@ "version": "0.0.0", "type": "module", "scripts": { - "docs:dev": "vitepress dev src" + "dev": "pnpm run start", + "start": "vitepress dev src" }, "devDependencies": { "@si/eslint-config": "workspace:*", @@ -16,5 +17,8 @@ }, "volta": { "extends": "../../package.json" + }, + "dependencies": { + "dotenv": "^16.0.3" } } diff --git a/app/docs/src/.vitepress/config.ts b/app/docs/src/.vitepress/config.ts index 1396b3a427..458c75185e 100644 --- a/app/docs/src/.vitepress/config.ts +++ b/app/docs/src/.vitepress/config.ts @@ -1,28 +1,33 @@ import { defineConfig } from "vitepress"; +import dotenv from "dotenv"; -async function load() { - return defineConfig({ - title: "System Initiative Docs", - description: "Description goes here", - markdown: { - theme: { - light: "github-light", - dark: "github-dark", - }, +dotenv.config(); + +export default defineConfig({ + title: "System Initiative Docs", + description: "Description goes here", + markdown: { + theme: { + light: "github-light", + dark: "github-dark", }, - cleanUrls: true, - themeConfig: { - nav: [ - { text: "Home", link: "/" }, - { text: "Tutorials", link: "/tutorials/" }, - { text: "Reference Docs", link: "/reference/" }, - { text: "Changelog", link: "/changelog/" }, - ], - search: { - provider: "local", - }, + }, + cleanUrls: true, + themeConfig: { + nav: [ + { text: "Home", link: "/" }, + { text: "Tutorials", link: "/tutorials/" }, + { text: "Reference Docs", link: "/reference/" }, + { text: "Changelog", link: "/changelog/" }, + ], + search: { + provider: "local", }, - }); -} - -export default load(); + }, + vite: { + server: { + host: process.env.DEV_HOST, + port: parseInt(process.env.DEV_PORT!, 10), + }, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a3690ea613..e5243fcbd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,6 +103,10 @@ importers: version: 1.8.27(typescript@4.9.5) app/docs: + dependencies: + dotenv: + specifier: ^16.0.3 + version: 16.0.3 devDependencies: '@si/eslint-config': specifier: workspace:*