diff --git a/app-shell/astro.config.mjs b/app-shell/astro.config.mjs index 87b89e9..3db4a0e 100644 --- a/app-shell/astro.config.mjs +++ b/app-shell/astro.config.mjs @@ -7,14 +7,21 @@ export default defineConfig({ react(), solidJs(), { - name: 'importmap-externals', + name: "importmap-externals", hooks: { - 'astro:build:setup': ({ vite, target }) => { - if(target === 'client') { - vite.build.rollupOptions["external"] = ["react", "react-dom", "solid-js"]; + "astro:build:setup": ({ vite, target }) => { + if (target === "client") { + vite.build.rollupOptions["external"] = [ + "react", + "react-dom", + "solid-js", + "app-cart", + "app-heading", + "app-products", + ]; } - } - } + }, + }, }, ], }); diff --git a/app-shell/src/components/ReactComponent.jsx b/app-shell/src/components/ReactComponent.jsx index 9e62996..30d2aad 100644 --- a/app-shell/src/components/ReactComponent.jsx +++ b/app-shell/src/components/ReactComponent.jsx @@ -1,15 +1,13 @@ -import MicroFrontendA from "http://localhost:7100/bundle.js"; -import MicroFrontendB from "http://localhost:7200/bundle.js"; +import Cart from "app-cart"; +import Heading from "app-heading"; const ReactComponent = (props) => { const { title } = props; - console.log(">>> title", title); - return ( <> - - + + ); }; diff --git a/app-shell/src/components/SolidComponent.jsx b/app-shell/src/components/SolidComponent.jsx index 96d79ba..dfccb68 100644 --- a/app-shell/src/components/SolidComponent.jsx +++ b/app-shell/src/components/SolidComponent.jsx @@ -1,9 +1,9 @@ -import MicroFrontendC from "http://localhost:7300/bundle.js"; +import Products from "app-products"; function App() { return ( <> - + ); } diff --git a/app-shell/src/pages/index.astro b/app-shell/src/pages/index.astro index b94d09f..7f99281 100644 --- a/app-shell/src/pages/index.astro +++ b/app-shell/src/pages/index.astro @@ -13,6 +13,9 @@ const appName = 'Scalable Shoe Shop'