diff --git a/src/plugin.ts b/src/plugin.ts index 13f0648..7f8944f 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -40,7 +40,7 @@ export = function ViteSsrPlugin( __CONTAINER_ID__: JSON.stringify(options.containerId || 'app'), // Vite 2.6.0 bug: use this // instead of import.meta.env.DEV - __DEV__: env.mode !== 'production', + __VITE_SSR_DEV__: env.mode !== 'production', }, ssr: { ...detectedFeats.ssr, diff --git a/src/react/entry-client.ts b/src/react/entry-client.ts index a38589e..8b565af 100644 --- a/src/react/entry-client.ts +++ b/src/react/entry-client.ts @@ -76,7 +76,7 @@ export const viteSSR: ClientHandler = async function ( styles && styles.cleanup && styles.cleanup() // @ts-ignore - __DEV__ ? ReactDOM.render(app, el) : ReactDOM.hydrate(app, el) + __VITE_SSR_DEV__ ? ReactDOM.render(app, el) : ReactDOM.hydrate(app, el) } } diff --git a/src/utils/html.ts b/src/utils/html.ts index 06e699e..bf5cb55 100644 --- a/src/utils/html.ts +++ b/src/utils/html.ts @@ -47,7 +47,7 @@ export function buildHtmlDocument( { htmlAttrs, bodyAttrs, headTags, body, initialState }: DocParts ) { // @ts-ignore - if (__DEV__) { + if (__VITE_SSR_DEV__) { if (template.indexOf(`id="${containerId}"`) === -1) { console.warn( `[SSR] Container with id "${containerId}" was not found in index.html` diff --git a/test/setup/globals.ts b/test/setup/globals.ts index b872725..d9c2a2f 100644 --- a/test/setup/globals.ts +++ b/test/setup/globals.ts @@ -1,5 +1,5 @@ const globals = { - __DEV__: false, + __VITE_SSR_DEV__: false, __CONTAINER_ID__: 'app', }