@appshell/loader
v0.4.0
Published
Utility for loading Appshell components
Downloads
58
Maintainers
Readme
@appshell/loader
Dynamically load Appshell components for micro-frontends built with Appshell and Webpack Module federation.
Working examples can be found here.
Getting Started
To begin, you'll need to install @appshell/loader
:
npm install @appshell/loader --save-dev
or
yarn add -D @appshell/loader
or
pnpm add -D @appshell/loader
The default export from this package is the loader function. It is given the global appshell configuration, and returns an async function that can be called to dynamically load Appshell components.
import componentLoader from '@appshell/loader';
const load = componentLoader(config);
const Component = load<MyComponent>('MyModule/MyComponent');
render(<Component />);
Where does the global appshell configuration come from?
See @appshell/cli
appshell generate global-config --registry appshell_registry_path
Do you have any framework specific loaders?
See @appshell/react for a
React
loader.