From c9e911497b70c3f1715e77eee800681f152e4d31 Mon Sep 17 00:00:00 2001 From: reitelli Date: Wed, 14 Aug 2024 19:20:27 +0200 Subject: [PATCH] fix relative path in container --- packages/container/config/webpack.prod.js | 2 +- packages/container/src/components/AuthApp.js | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/container/config/webpack.prod.js b/packages/container/config/webpack.prod.js index 9c31493..36c767a 100644 --- a/packages/container/config/webpack.prod.js +++ b/packages/container/config/webpack.prod.js @@ -9,7 +9,7 @@ const prodConfig = { mode: "production", output: { filename: "[name].[contenthash].js", - publicPath: "container/latest/", + publicPath: "/container/latest/", }, plugins: [ new ModuleFederationPlugin({ diff --git a/packages/container/src/components/AuthApp.js b/packages/container/src/components/AuthApp.js index 9817169..1123d59 100644 --- a/packages/container/src/components/AuthApp.js +++ b/packages/container/src/components/AuthApp.js @@ -8,16 +8,14 @@ export default function AuthApp({ onSignIn }) { useEffect(() => { const { onParentNavigate } = mount(ref.current, { - onNavigate: ({ pathname: nexPathname }) => { + initialPath: history.location.pathname, + onNavigate: ({ pathname: nextPathname }) => { const { pathname } = history.location; - if (pathname !== nexPathname) { - history.push(nexPathname); + if (pathname !== nextPathname) { + history.push(nextPathname); } }, - initialPath: history.location.pathname, - onSignIn: () => { - onSignIn(); - }, + onSignIn: onSignIn, }); history.listen(onParentNavigate); }, []);