Skip to content

Latest commit

 

History

History
23 lines (10 loc) · 1010 Bytes

File metadata and controls

23 lines (10 loc) · 1010 Bytes

web-component-micro-frontend

Description

This is a helloworld style nodejs/vite web component app. When built and run, serves a micro frontend as a static resource that can be embedded in an external web app like main app. A demo of an external main app embedding this web component can be viewed here.

Usage

When built and deployed, this app listens for a custom event 'my-custom-event' and echoes the event.detail.message when it receives the event.

When built, the dist folder will have the js that an external main app can include as a micro frontend.

Build and Run

npm install

npm run build << the dist folder should have a new exported my-widget.iife.js file >>

npm run dev << accessing http://localhost:8081 should display: "my-widget micro-frontend waiting for my-custom-event: " >>