Skip to content

Commit

Permalink
chore: use debug env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Sep 24, 2023
1 parent fd82d1a commit c9296e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/.vitepress/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_DEBUG: boolean
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
async enhanceApp({ app }) {
if (!import.meta.env.SSR) {
const plugin = await import("../../../src");
app.use(plugin, { debug: true });
app.use(plugin, { debug: !!import.meta.env.VITE_DEBUG });
}
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"build": "vite build",
"serve": "vite preview",
"docs:dev": "vitepress dev docs",
"docs:dev:debug": "VITE_DEBUG=true npm run docs:dev",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"docs:update-requirements": "node scripts/insert-required-versions.mjs README.md docs/get-started.md",
Expand Down

0 comments on commit c9296e6

Please # to comment.