0.1.2 • Published 1 year ago

@outfit.io/single-spa-starter-files v0.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@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/single-spa-starter-files@0.1.0/build/importmap-vendor.json"></script>
    <script type="systemjs-importmap" src="importmap.json"></script>
    <script src="https://unpkg.com/import-map-overrides@2.2.0/dist/import-map-overrides.js"></script>
    <script src="https://unpkg.com/systemjs@6.8.3/dist/system.min.js"></script>
    <script src="https://unpkg.com/systemjs@6.8.3/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/single-spa-starter-files@0.1.0/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>