0.0.1 • Published 1 year ago

@firesoon/plugin-micro-devtool v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@firesoon/plugin-micro-devtool

安装

npm install @firesoon/plugin-micro-devtool --save-dev

使用

  • .umirc.ts文件
{
    plugins: [
        '@firesoon/plugin-micro-devtool',
    ],
}
  • micro.config.ts 文件
export const host = 'http://10.224.0.74'

export const appPlatform = '/appPlatform/api/appPlatform/';

/**
 * 接口代理
 */
const apiProxy = {
    [appPlatform]: {
        target: host,
        changeOrigin: true,
    },
    '/drg/api':{
        target: host,
        changeOrigin: true,
    }
}

/**
 * 远程应用代理
 */
const remoteMicroProxy = {
    // '/drg': {
    //     target: 'http://10.224.0.74',
    //     changeOrigin: true,
    // }
}

/**
 * 本地应用配置项
 * {
 *    name: 应用名称
 *    activePath:应用激活路径
 *    entry: 入口
 * }
 */
export const microApps = process.env.NODE_ENV === 'development' ? [
    {
        name: 'drg',
        activePath: '/drg',
        entry: 'http://localhost:3003',
    },
] : []

/**
 * 模块联邦配置
 */
export const mfConfig = {
    mf: 'mf@http://localhost:3030/remoteEntry.js',
}

export const proxy = {
    ...apiProxy,
    ...remoteMicroProxy
}

修改记录

0.0.1

1 year ago