mirror of
https://github.com/unraid/api.git
synced 2026-01-09 01:59:57 -06:00
feat: add env for allowing console logs on build
This commit is contained in:
@@ -2,3 +2,4 @@ VITE_ACCOUNT=https://localhost:8008
|
||||
VITE_CONNECT=https://connect.myunraid.net
|
||||
VITE_UNRAID_NET=https://unraid.ddev.site
|
||||
VITE_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams
|
||||
VITE_ALLOW_CONSOLE_LOGS=false
|
||||
@@ -2,7 +2,7 @@
|
||||
export const OBJ_TO_STR = (obj: object): string => Object.entries(obj).reduce((str, [p, val]) => `${str}${p}: ${val}\n`, '');
|
||||
/** Removes our dev logs from prod builds */
|
||||
export const disableProductionConsoleLogs = () => {
|
||||
if (import.meta.env.PROD) {
|
||||
if (import.meta.env.PROD && !import.meta.env.VITE_ALLOW_CONSOLE_LOGS) {
|
||||
console.log = () => {};
|
||||
console.debug = () => {};
|
||||
console.info = () => {};
|
||||
|
||||
Reference in New Issue
Block a user