From 9b7283c7048138aeb0a2e11a9ddc13d978913c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Naarttij=C3=A4rvi?= Date: Thu, 26 Aug 2021 16:02:58 +0200 Subject: [PATCH 1/2] Remove broken import that crashes Vite builds Remove type import and declare it again. The bundler does not know to remove InitializePayload from the import, making builds fail for Vite (esbuild). Fixes #223 --- src/LocalizeProvider.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/LocalizeProvider.js b/src/LocalizeProvider.js index 62649cf..f532812 100644 --- a/src/LocalizeProvider.js +++ b/src/LocalizeProvider.js @@ -8,8 +8,7 @@ import { type LocalizeState, type Action, initialize as initializeAC, - INITIALIZE, - InitializePayload + INITIALIZE } from './localize'; import { LocalizeContext, @@ -22,6 +21,12 @@ type LocalizeProviderState = { localize: LocalizeState }; +type InitializePayload = { + languages: Array, + translation?: Object, + options?: InitializeOptions +}; + export type LocalizeProviderProps = { store?: any, getState?: Function, From 2f7a0e06c7b2310fdb2724de5b3f19300a9d4906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Naarttij=C3=A4rvi?= Date: Fri, 27 Aug 2021 07:46:14 +0200 Subject: [PATCH 2/2] Add type to import --- src/LocalizeProvider.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/LocalizeProvider.js b/src/LocalizeProvider.js index f532812..b68c0b8 100644 --- a/src/LocalizeProvider.js +++ b/src/LocalizeProvider.js @@ -8,7 +8,8 @@ import { type LocalizeState, type Action, initialize as initializeAC, - INITIALIZE + INITIALIZE, + type InitializePayload } from './localize'; import { LocalizeContext, @@ -21,12 +22,6 @@ type LocalizeProviderState = { localize: LocalizeState }; -type InitializePayload = { - languages: Array, - translation?: Object, - options?: InitializeOptions -}; - export type LocalizeProviderProps = { store?: any, getState?: Function,