Skip to content

single-spa A javascript router for front-end microservices

Notifications You must be signed in to change notification settings

ROCKY-SAM/microfrontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro frontend

Single-spa A javascript router for front-end microservices

image

Applications types

Angular appOne,appTwo, Navigation
React appThree

To install singleSPA

npm install -g create-single-spa

To create singleSPA application

npx create-single-spa

Configure root config application

image

Create singleSPA application - React

image

Create singleSPA application - Angular

image

Issues need to fix in angular

Add to package.json

"@angular-builders/custom-webpack": "^8",

Add to routing(angular)

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EmptyRouteComponent } from './empty-route/empty-route.component'
import { APP_BASE_HREF } from '@angular/common';


const routes: Routes = [
  { path: '**', component: EmptyRouteComponent },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [
    { provide: APP_BASE_HREF, useValue: '/' },
  ],
})
export class AppRoutingModule { }

Uncomment in index.ejs

  <!--
    If you need to support Angular applications, uncomment the script tag below to ensure only one instance of ZoneJS is loaded
    Learn more about why at https://single-spa.js.org/docs/ecosystem-angular/#zonejs
  -->
  <script src="https://cdn.jsdelivr.net/npm/zone.js@0.11.3/dist/zone.min.js"></script>

Issues need to fix in React

  <script type="systemjs-importmap">
    {
      "imports": {
        "react": "https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js",
        "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js"
      }
    }
  </script>

image

About

single-spa A javascript router for front-end microservices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published