1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 19:25:32 -04:00

consolidate environment variable parsing

This commit is contained in:
2022-09-12 15:42:56 -04:00
parent 0373f806f6
commit c64d6cfb52
7 changed files with 434 additions and 412 deletions

View File

@@ -1,6 +1,7 @@
import { useMemo } from "react";
import { minify } from "uglify-js";
import { clientScript } from "./client";
import { IS_DEV_SERVER } from "../../lib/config/constants";
export type ThemeScriptProps = JSX.IntrinsicElements["script"] & {
themeClassNames: {
@@ -21,7 +22,7 @@ const ThemeScript = ({ key, themeClassNames, themeStorageKey, ...rest }: ThemeSc
const unminified = `(${functionString})()`;
// skip minification if running locally to save a few ms
if (process.env.IS_DEV_SERVER === "true") {
if (IS_DEV_SERVER) {
return unminified;
}