diff --git a/src/app/i18n.ts b/src/app/i18n.ts index 73fc8054..cc58a1e8 100644 --- a/src/app/i18n.ts +++ b/src/app/i18n.ts @@ -3,7 +3,7 @@ import { initReactI18next } from 'react-i18next/initReactI18next' import resourcesToBackend from 'i18next-resources-to-backend' import i18nConfig from '~/i18nConfig' import OtaClient from '@crowdin/ota-client' -import { HMRPlugin } from 'i18next-hmr/plugin' + export const namespaces = ['common', 'art', 'states', 'stories'] export async function initTranslations( @@ -15,7 +15,8 @@ export async function initTranslations( i18nInstance = i18nInstance ?? createInstance() i18nInstance.use(initReactI18next) - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && !process.env.VERCEL) { + const { HMRPlugin } = await import('i18next-hmr/plugin') i18nInstance.use( new HMRPlugin({ webpack: { client: typeof window !== 'undefined', server: typeof window === 'undefined' },