File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const moduleFederationPlugin = (
2323 originPluginOptions : userConfig ,
2424 remoteIpStrategy : userConfig ?. remoteIpStrategy ,
2525 userConfig : userConfig || { } ,
26- manifestName : { } ,
26+ assetFileNames : { } ,
2727 fetchServerQuery : userConfig . fetchServerQuery ?? undefined ,
2828 } ;
2929 return {
Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ import type {
2323 ModifyRspackConfigFn ,
2424} from '@rsbuild/core' ;
2525import type { CliPluginFuture , AppTools } from '@modern-js/app-tools' ;
26- import type { InternalModernPluginOptions , PluginOptions } from '../types' ;
26+ import type {
27+ AssetFileNames ,
28+ InternalModernPluginOptions ,
29+ PluginOptions ,
30+ } from '../types' ;
2731
2832export function setEnv ( ) {
2933 process . env [ 'MF_SSR_PRJ' ] = 'true' ;
@@ -33,7 +37,7 @@ export const CHAIN_MF_PLUGIN_ID = 'plugin-module-federation-server';
3337
3438function getManifestAssetFileNames (
3539 manifestOption ?: moduleFederationPlugin . ModuleFederationPluginOptions [ 'manifest' ] ,
36- ) : { statsFileName : string ; manifestFileName : string } {
40+ ) : AssetFileNames {
3741 if ( ! manifestOption ) {
3842 return {
3943 statsFileName : StatsFileName ,
@@ -86,10 +90,10 @@ const mfSSRRsbuildPlugin = (
8690 let csrEnv = '' ;
8791
8892 const browserAssetFileNames =
89- pluginOptions . manifestName ? .browser ||
93+ pluginOptions . assetFileNames . browser ||
9094 getManifestAssetFileNames ( pluginOptions . csrConfig ?. manifest ) ;
9195 const nodeAssetFileNames =
92- pluginOptions . manifestName ?. node ||
96+ pluginOptions . assetFileNames ?. node ||
9397 getManifestAssetFileNames ( pluginOptions . ssrConfig ?. manifest ) ;
9498
9599 const collectAssets = (
Original file line number Diff line number Diff line change @@ -15,16 +15,20 @@ export interface PluginOptions {
1515 fetchServerQuery ?: Record < string , unknown > ;
1616}
1717
18+ export type AssetFileNames = {
19+ statsFileName : string ;
20+ manifestFileName : string ;
21+ } ;
1822export interface InternalModernPluginOptions {
1923 csrConfig ?: moduleFederationPlugin . ModuleFederationPluginOptions ;
2024 ssrConfig ?: moduleFederationPlugin . ModuleFederationPluginOptions ;
2125 distOutputDir : string ;
2226 originPluginOptions : PluginOptions ;
2327 browserPlugin ?: BundlerPlugin ;
2428 nodePlugin ?: BundlerPlugin ;
25- manifestName : {
26- node ?: string ;
27- browser ?: string ;
29+ assetFileNames : {
30+ node ?: AssetFileNames ;
31+ browser ?: AssetFileNames ;
2832 } ;
2933 assetResources : {
3034 browser ?: StatsAssetResource ;
You can’t perform that action at this time.
0 commit comments