Skip to content

Commit

Permalink
fix: remove dark mode script during build when disabled in config (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmNudge authored Nov 29, 2023
1 parent bfc0e80 commit 7841e4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tidy-geckos-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rspress/core': patch
---

fix: disable dark mode script when darkMode is false in config
4 changes: 3 additions & 1 deletion packages/core/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ export async function renderPages(
helmet?.link?.toString(),
helmet?.style?.toString(),
helmet?.script?.toString(),
CHECK_DARK_LIGHT_SCRIPT,
config.themeConfig?.darkMode !== false
? CHECK_DARK_LIGHT_SCRIPT
: '',
])
.join(''),
);
Expand Down

0 comments on commit 7841e4c

Please sign in to comment.