Skip to content

[Feature Request] mf 插件的 entry 支持变量 #13250

@fengsx

Description

@fengsx

Background

mf 插件在配置 remotes 时 entries 仅支持传入 url,不具备运行时动态根据环境信息、版本号等因素确定最终加载资源地址的能力。

Proposal

{
//...
  mf: {
    name: 'hostUser',
    remotes: [
      {
        name: 'remoteCounter',
        entries: {
          DEV: 'window.mfRemoteUrl',  // 支持变量
          PROD: 'https://production.com/remote.js', // 支持 url
        },
        keyResolver: `(() => 'DEV')()`,
      },
      {
        aliasName: 'utopia',
        name: 'notExist',
        entry: 'http://1.2.3.4:404/bad_file.js',
      },
    ],
    shared,
  },
}

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions