Based on a talk: https://slides.com/evanpayne/microfrontends-with-svelte
The Sample Svelte SPA/MicroFrontend is a Svelte project that compiles into a single JS file. This file can be published and integrated into other app-shells in a micro-frontend manner. The project provides a way to create and deploy microfrontend components that can be used in various applications.
To use the Sample Svelte SPA/MicroFrontend, follow these steps:
npm run build./public/build/itemdetail.js file.itemdetail.js file to a publicly accessible URL.src attribute with the URL of the itemdetail.js file:<script type="module" src="https://.../itemdetail.js"></script>
<itemdetail-spa issueid="1234" theme="dark" baseapiurl="https://evanpayne.com" preview="true" />
Note: The baseapiurl and theme attributes are optional. The issueid (required if preview is set to true) and preview attributes are required. The order of the attributes should be maintained as mentioned above.
The Sample Svelte SPA/MicroFrontend is a project that allows you to create a standalone microfrontend component using Svelte. It compiles the component into a single JS file, which can be integrated into other app-shells following the microfrontend architecture. The component supports customization options such as theme, issue ID, base API URL, and preview mode. The installation process involves building the project, deploying the generated JS file, and including it in the desired application using a script tag.