diff --git a/admin/App.svelte b/admin/App.svelte index 5ba87ea..48e03e8 100644 --- a/admin/App.svelte +++ b/admin/App.svelte @@ -7,7 +7,7 @@ -{#if process.env.DANGER_ADMIN === "1"} +{#if process.env.DANGER_ADMIN} {/if} diff --git a/client/App.svelte b/client/App.svelte index fdef7d3..9bf77ce 100644 --- a/client/App.svelte +++ b/client/App.svelte @@ -7,7 +7,7 @@ -{#if process.env.DANGER_ADMIN === "1"} +{#if process.env.DANGER_ADMIN} {/if} diff --git a/commands/build.js b/commands/build.js index c5104a2..b671f8d 100644 --- a/commands/build.js +++ b/commands/build.js @@ -118,8 +118,8 @@ const devMode = () => ({ setup(build) { const options = build.initialOptions; options.define = options.define || {}; - // esbuild 0.16 went insane and now type checks environment variables. What a bunch of idiots. - options.define['process.env.DANGER_ADMIN'] = options.minify ? "1" : "0"; + // esbuild 0.16 requires this to be a string, but changes it to code so this will be an actual boolean type in the code + options.define['process.env.DANGER_ADMIN'] = options.minify ? "false" : "true"; } })