| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /**
- *微应用apps
- * @name: 微应用名称 - 具有唯一性
- * @entry: 微应用入口.必选 - 通过该地址加载微应用,
- * @container: 微应用挂载节点 - 微应用加载完成后将挂载在该节点上
- * @activeRule: 微应用触发的路由规则 - 触发路由规则后将加载该微应用
- */
- //子应用列表
- const _apps: object[] = [];
- for (const key in import.meta.env) {
- if (key === 'VITE_APP_SUB_APP') {
- const appList = JSON.parse(import.meta.env[key].replace(/'/g, '"'));
- appList.forEach((app) => {
- const name = app[0];
- const obj = {
- name,
- entry: app[1],
- container: '#content',
- activeRule: name,
- };
- _apps.push(obj);
- });
- }
- }
- console.log('子应用路由匹配规则', _apps);
- // const _apps: object[] = [
- // {
- // name: 'micro-need-air', // app name registered
- // entry: '//localhost:8099/',
- // container: '#content',
- // activeRule: 'micro-need-air',
- // },
- // {
- // name: 'micro-vent-3dModal', // app name registered
- // entry: '//localhost:8091/',
- // container: '#content',
- // activeRule: 'micro-vent-3dModal',
- // },
- // // {
- // // name: 'micro-vent-3dModal', // app name registered
- // // entry: '//localhost:8091/',
- // // container: '#content',
- // // activeRule: 'micro-vent-3dModal',
- // // },
- // ];
- export const apps = _apps;
|