@outfit.io/single-spa-starter-files
v0.1.2
Published
A collection of starter and required files to get a single spa template going
Downloads
357
Keywords
Readme
@outfit.io/single-spa-starter-files
A collection of starter and required files to get a single spa template going
Usage
A single single template requires some boilerplate so the template developer doesn't have to set it up each time. This includes
- The importmap vendor code,
- The root config, the file that mounts the micro frontends,
- A starter single spa micro frontend, so templates see something initially. This is meant is intentionally meant to get replaced when template developers start making their template.
A typical index.html
in a template will looks something like the following
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>React Microfrontends</title>
<!-- Injection Start -->
<meta name="importmap-type" content="systemjs-importmap" />
<script type="systemjs-importmap" src="https://unpkg.com/@outfit.io/[email protected]/build/importmap-vendor.json"></script>
<script type="systemjs-importmap" src="importmap.json"></script>
<script src="https://unpkg.com/[email protected]/dist/import-map-overrides.js"></script>
<script src="https://unpkg.com/[email protected]/dist/system.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/extras/amd.min.js"></script>
<script src="templates.js"></script>
<!-- Injection End -->
</head>
<body>
<div id="root"></div>
<!-- Injection Start -->
<script src="https://unpkg.com/@outfit.io/[email protected]/dist/single-spa-root-config.js"></script>
<import-map-overrides-full show-when-local-storage="devtools" dev-libs></import-map-overrides-full>
<!-- Injection End -->
</body>
</html>