Skip to content

Commit

Permalink
Fix remaining __DEV__ globals (#1549)
Browse files Browse the repository at this point in the history
* Fix remaining __DEV__ globals

* inverse conditional
  • Loading branch information
grod220 authored Jul 24, 2024
1 parent ae50230 commit 3477bef
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .changeset/curvy-grapes-serve.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion apps/minifront/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand Down
10 changes: 6 additions & 4 deletions apps/node-status/vite.config.ts
Original file line number Diff line number Diff line change
@@ -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()],
};
});
6 changes: 4 additions & 2 deletions packages/query/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -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' },
};
});
6 changes: 4 additions & 2 deletions packages/types/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -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' },
};
});
8 changes: 5 additions & 3 deletions packages/wasm/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -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()],
};
});

0 comments on commit 3477bef

Please sign in to comment.