ice
ice copied to clipboard
build.json中自定义 moduleFederation 时,无法同时配置 remotes 和 exposes
What is the current behavior? 发生了什么?
build.json中自定义 moduleFederation 时,无法同时配置为 host 和 remote,webpack编译出来的文件报语法错误;
moduleFederation : { name: 'MF_subAppMF', shared: { react: { singleton: true }, 'react-dom': { singleton: true }, 'react-router': { singleton: true }, 'react-router-dom': { singleton: true }, '@alifd/next': { singleton: true }, echarts: { singleton: true } }, exposes: { './MicroPage': './src/pages/Examples/MicroPage' }, remotes: { MF_subAppMF: 'MF_subAppMF@//localhost:9999/remoteEntry.js' }, library: { type: 'var', name: 'MF_subAppMF' }, filename: 'remoteEntry.js' }
打包出来的异常代码:

移除filename,library,exposes等remote相关配置,正常打包出来的代码为:

What is the expected behavior? 期望的结果是什么?
能将一个应用同时构建为host和remote
Any additional comments? 相关环境信息?
- ice.js Version: 2.6.0
- build.json Configuration:
- Node Version:
- Platform:
先确认下配置步骤 https://github.com/alibaba/ice/issues/4900
配置如图, 同时配置 exposes和 remotes时会复现以上bug, 其他情况无问题,
@ClarkXia