diff --git a/.changeset/curvy-grapes-serve.md b/.changeset/curvy-grapes-serve.md new file mode 100644 index 0000000000..cc541b5a1a --- /dev/null +++ b/.changeset/curvy-grapes-serve.md @@ -0,0 +1,8 @@ +--- +'node-status': patch +'@penumbra-zone/query': patch +'@penumbra-zone/types': patch +'@penumbra-zone/wasm': patch +--- + +bugfix: injecting globalThis.**DEV** correctly on prod builds diff --git a/apps/minifront/vite.config.ts b/apps/minifront/vite.config.ts index c452c49c52..195904f20a 100644 --- a/apps/minifront/vite.config.ts +++ b/apps/minifront/vite.config.ts @@ -8,7 +8,7 @@ import polyfillNode from 'vite-plugin-node-stdlib-browser'; export default defineConfig(({ mode }) => { return { - define: { 'globalThis.__DEV__': mode === 'development' }, + define: { 'globalThis.__DEV__': mode !== 'production' }, clearScreen: false, base: './', plugins: [polyfillNode(), react(), basicSsl(), commitInfoPlugin()], diff --git a/apps/node-status/vite.config.ts b/apps/node-status/vite.config.ts index 638eefa3d3..874ec2cbc6 100644 --- a/apps/node-status/vite.config.ts +++ b/apps/node-status/vite.config.ts @@ -1,8 +1,10 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -export default defineConfig({ - define: { 'globalThis.__DEV__': 'import.meta.env.DEV' }, - clearScreen: false, - plugins: [react()], +export default defineConfig(({ mode }) => { + return { + define: { 'globalThis.__DEV__': mode !== 'production' }, + clearScreen: false, + plugins: [react()], + }; }); diff --git a/packages/query/vitest.config.ts b/packages/query/vitest.config.ts index c1651dd515..0c2847ad53 100644 --- a/packages/query/vitest.config.ts +++ b/packages/query/vitest.config.ts @@ -1,5 +1,7 @@ import { defineConfig } from 'vitest/config'; -export default defineConfig({ - define: { 'globalThis.__DEV__': 'import.meta.env.DEV' }, +export default defineConfig(({ mode }) => { + return { + define: { 'globalThis.__DEV__': mode !== 'production' }, + }; }); diff --git a/packages/types/vitest.config.ts b/packages/types/vitest.config.ts index c1651dd515..0c2847ad53 100644 --- a/packages/types/vitest.config.ts +++ b/packages/types/vitest.config.ts @@ -1,5 +1,7 @@ import { defineConfig } from 'vitest/config'; -export default defineConfig({ - define: { 'globalThis.__DEV__': 'import.meta.env.DEV' }, +export default defineConfig(({ mode }) => { + return { + define: { 'globalThis.__DEV__': mode !== 'production' }, + }; }); diff --git a/packages/wasm/vitest.config.ts b/packages/wasm/vitest.config.ts index e5675c629f..80308faab5 100644 --- a/packages/wasm/vitest.config.ts +++ b/packages/wasm/vitest.config.ts @@ -1,7 +1,9 @@ import { defineConfig } from 'vitest/config'; import wasm from 'vite-plugin-wasm'; -export default defineConfig({ - define: { 'globalThis.__DEV__': 'import.meta.env.DEV' }, - plugins: [wasm()], +export default defineConfig(({ mode }) => { + return { + define: { 'globalThis.__DEV__': mode !== 'production' }, + plugins: [wasm()], + }; });