@autobest-ui/module-federation-runtime-plugin
v3.0.0-alpha.0
Published
module-federation-runtime-plugin for webpack ModuleFederationPlugin build
Downloads
12
Readme
@autobest-ui/module-federation-runtime-plugin
介绍
用于webpack ModuleFederationPlugin下,prod build打包时设置runtimeChunk
时不能正常加载共享文件问题。
如下:
runtimeChunk: {
name: 'manifest'
}
安装
npm install @autobest-ui/module-federation-runtime-plugin --save-dev
使用方式
const ModuleFederationRuntimePlugin = require('@autobest-ui/module-federation-runtime-plugin');
// webpack.config.js下新增
plugin: [
new ModuleFederationRuntimePlugin({
// 共享文件名,与ModuleFederationPlugin参数filename对应
remoteEntryName: 'remoteEntry.js',
// runtimeChunk的值
runtimeChunkName: 'manifest.js',
})
]
| 参数名 | 默认值 | 说明 | | ---- |------|-------------------------------------------| | remoteEntryName | 'remoteEntry.js' | 共享文件名,与ModuleFederationPlugin参数filename对应 | | runtimeChunkName | 'manifest.js' | runtimeChunk的值,single是'runtime.js' | | cacheGroupsVendorName | 'vendor' | splitChunks.cacheGroups下设置的外部依赖名 |