From b74ffdfec07ae541b704756d25818a077864cf32 Mon Sep 17 00:00:00 2001 From: Adriano Raiano Date: Mon, 24 Apr 2023 12:48:36 +0200 Subject: [PATCH] try to fix conditional exports in package.json #1634 --- CHANGELOG.md | 4 ++++ package.json | 12 +++++++++--- src/index.js | 14 ++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f4a70479..dc16e35c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 12.2.2 + +- try to fix conditional exports in package.json + ### 12.2.1 - type fix: the type of defaultNS in I18nextProvider should support string[] [1633](https://github.com/i18next/react-i18next/pull/1633) diff --git a/package.json b/package.json index 7e81fb249..738442b29 100644 --- a/package.json +++ b/package.json @@ -21,18 +21,24 @@ "./package.json": "./package.json", ".": { "types": "./index.d.ts", + "module": "./dist/es/index.js", "import": "./dist/es/index.js", - "require": "./dist/commonjs/index.js" + "require": "./dist/commonjs/index.js", + "default": "./dist/es/index.js" }, "./TransWithoutContext": { "types": "./TransWithoutContext.d.ts", + "module": "./dist/es/TransWithoutContext.js", "import": "./dist/es/TransWithoutContext.js", - "require": "./dist/commonjs/TransWithoutContext.js" + "require": "./dist/commonjs/TransWithoutContext.js", + "default": "./dist/es/TransWithoutContext.js" }, "./initReactI18next": { "types": "./initReactI18next.d.ts", + "module": "./dist/es/initReactI18next.js", "import": "./dist/es/initReactI18next.js", - "require": "./dist/commonjs/initReactI18next.js" + "require": "./dist/commonjs/initReactI18next.js", + "default": "./dist/es/initReactI18next.js" } }, "homepage": "https://github.com/i18next/react-i18next", diff --git a/src/index.js b/src/index.js index 01127e6c9..558350614 100644 --- a/src/index.js +++ b/src/index.js @@ -6,17 +6,11 @@ export { Translation } from './Translation.js'; export { I18nextProvider } from './I18nextProvider.js'; export { withSSR } from './withSSR.js'; export { useSSR } from './useSSR.js'; +export { initReactI18next } from './initReactI18next.js'; +export { setDefaults, getDefaults } from './defaults.js'; +export { setI18n, getI18n } from './i18nInstance.js'; -export { - I18nContext, - initReactI18next, - setDefaults, - getDefaults, - setI18n, - getI18n, - composeInitialProps, - getInitialProps, -} from './context.js'; +export { I18nContext, composeInitialProps, getInitialProps } from './context.js'; // dummy functions for icu.macro support