0.0.21 • Published 1 year ago
hawaii-dev-tools v0.0.21
Hawaii Developer Tools
Collection of packages to help with development in Hawaii.
Hawaii Proxy
The Hawaii Proxy enables a fully integrated development experience by allowing the developer to proxy requests to a remote server.
This is useful for:
- Developing an MFE in the context of the real-world applications and user experiences
- Developing against a remote server without having to deal with CORS issues
- Developing against other local MFEs for cross-cutting concerns
Installation
Install the package:
npm i hawaii-dev-tools
Import the package in rsbuild.config.ts
import { hawaiiProxy } from 'hawaii-dev-tools';Configuration
import { hawaiiProxy } from 'hawaii-dev-tools';
// Mapping of MFEs to ports. Can be local or remote.
const hawaiiProxyMap = {
someOtherMfeName: 'http://localhost:someOtherLocalPort/',
};
const hawaiiProxyConfig = {
packageName: 'nameOfMFEWhereProxyIsLocated', // the current package name
targetEnv: 'https://xxxxxxxxxxxxxxxxxxxx/', // where to proxy the requests
fallback: 'https://xxxxxxxxxxxxxxxxxxxx/',
proxyMap: hawaiiProxyMap,
logLevel: 'debug', // optional
};Usage
export default defineConfig(() => {
return {
server: {
proxy: hawaiiProxy(hawaiiProxyConfig),
},
};
});Hawaii Middleware
Hawaii middleware is used to override the Platform and Product manifest files.
This is useful for:
- Developing more than one MFE at the same time
- Adding a new MFE for local development
- Updating and testing integration configurations
Rslib Project
Setup
Install the dependencies:
pnpm installGet Started
Build the library:
pnpm buildBuild the library in watch mode:
pnpm dev