single-spa-layout | Layout engine for single-spa applications | Single Page Application library
kandi X-RAY | single-spa-layout Summary
kandi X-RAY | single-spa-layout Summary
Layout engine for single-spa applications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Constructs a layout engine .
- Validates route configuration object
- Converts an element to an HTML representation .
- Validate route
- Serialize an application node .
- Recursive function that creates the application and app containers .
- Places the loader to load the application .
- Constructs a ServerLayout Layout
- Send a layout response
- Method to process the children of a Node
single-spa-layout Key Features
single-spa-layout Examples and Code Snippets
Community Discussions
Trending Discussions on single-spa-layout
QUESTION
The question:
How (is it possible) to configure webpack (with single-spa), to take make some packages (projects) under a scope (@orginazation) externals and other internals (not external) ?
Project information:
We are building a single-spa application using webpack an uses Github npm registrer (and github actions). All the micro front-ends are projects in Github, and some of them are util/helper/provider projects, that is compiled as externals with webpack.
But some of them are meant to be compiled with the micro-frontend (must not be external)
It seems that when webpack sees one of the project under the organization scope as external, it set all package under that scope to external!
As we can see from the log the "CompilingTool" will also be compiled as external, event thought it should not.
The packages are set in the files as:
...ANSWER
Answered 2021-Aug-05 at 15:14This is possible by passing in orgPackagesAsExternal: false
to the single-spa webpack config, in your case named singleSpaDefaults
. Per the create-single-spa documentation,
This changes whether package names that start with @your-org-name are treated as webpack externals or not. Defaults to true.
You will then need to either:
- Enumerate which packages to mark as external
- Provide a function that does this (which you've noted in your question)
and then merge that with single-spa's config as usual. Because this can become verbose and annoying to do for every microfrontend, consider doing this in a base config that you publish that is specific for your company and which each mfe will then need to consume.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install single-spa-layout
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page