Add Child App without CLI
Create new repo
Init package-manager
Add necessarily package for child app
yarn add --dev @tramvai/cli
yarn add @tramvai/child-app-coreCreate new file
tramvai.json
in the root with following content{
"$schema": "./node_modules/@tramvai/cli/schema.json",
"projects": {
"[name]": {
"name": "[name]",
"root": "src",
"type": "child-app"
}
}
}Add scripts to
package.json
for run child in dev and prod mode:{
"scripts": {
"start": "tramvai start [name]",
"build": "tramvai build [name]"
}
}Implement your React-component wrapper (for example in
./src/component.tsx
)Add new file
./src/entry.ts
for you app with following content:import { createChildApp } from '@tramvai/child-app-core';
import { ChildAppComponent } from './component';
// eslint-disable-next-line import/no-default-export
export default createChildApp({
name: '[name]',
modules: [],
render: ChildAppComponent,
});