tjvsx / svelte-single-spa-example

This is demo app that uses Single-SPA with Svelte. It's a Mono-repo that uses Turborepo and pnpm. It is also using Svelte-Routing to reduce hard page reloads on page navigation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turborepo starter with pnpm

This is a Mono-repo built with Turborepo and uses pnpm as the packages manager. So you'll need to have pnpm installed in order to run things.

Develop

Note some warnings about peer dependencies come up after the install step. You can ignore these...I just didn't have time to fix them yet.

To develop all apps and packages, run the following command:

cd svelte-single-spa-example
pnpm install
pnpm run dev

Then go to http://localhost:9000 to see the website running locally. Each of the pages is being served up via sirv, in order to mock coming from a CDN.

This is not a complete setup, and more is needed to get it to a production level. For example, I have not setup import-mapping through CDN for your different staged environments, husky isn't complete, reduce bundle size by moving common dependencies to root single-spa imports, etc.

If you desire to use this as a starting point, please fork the repo and then do a simple search & replace for my name bryce with whatever org name you plan on using.

Lastly if you want to see a simple redirect based on the existence of a Json Web Token (JWT) then uncomment line 16 in web/navbar/src/App.svelte

About

This is demo app that uses Single-SPA with Svelte. It's a Mono-repo that uses Turborepo and pnpm. It is also using Svelte-Routing to reduce hard page reloads on page navigation.


Languages

Language:JavaScript 58.8%Language:EJS 21.2%Language:Svelte 15.6%Language:HTML 2.2%Language:TypeScript 2.1%