File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
packages/modernjs/src/cli Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/modern-js ' : patch
3
+ ---
4
+
5
+ fix(modern-js-plugin): apply ssr.distOutputDir in bundlerChain
Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ const mfSSRRsbuildPlugin = (
70
70
? pluginOptions . userConfig . ssr
71
71
: { }
72
72
: { } ;
73
- config . output ! . publicPath = `${ config . output ! . publicPath } ${ userSSRConfig . distOutputDir || path . relative ( csrOutputPath , ssrOutputPath ) } /` ;
73
+ if ( userSSRConfig . distOutputDir ) {
74
+ return ;
75
+ }
76
+ config . output ! . publicPath = `${ config . output ! . publicPath } ${ path . relative ( csrOutputPath , ssrOutputPath ) } /` ;
74
77
return config ;
75
78
} ;
76
79
api . modifyWebpackConfig ( ( config , utils ) => {
@@ -148,6 +151,17 @@ export const moduleFederationSSRPlugin = (
148
151
. plugin ( 'UniverseEntryChunkTrackerPlugin' )
149
152
. use ( UniverseEntryChunkTrackerPlugin ) ;
150
153
}
154
+ const userSSRConfig = pluginOptions . userConfig . ssr
155
+ ? typeof pluginOptions . userConfig . ssr === 'object'
156
+ ? pluginOptions . userConfig . ssr
157
+ : { }
158
+ : { } ;
159
+ const publicPath = chain . output . get ( 'publicPath' ) ;
160
+ if ( userSSRConfig . distOutputDir && publicPath ) {
161
+ chain . output . publicPath (
162
+ `${ publicPath } ${ userSSRConfig . distOutputDir } /` ,
163
+ ) ;
164
+ }
151
165
}
152
166
153
167
if ( isDev && isWeb ) {
You can’t perform that action at this time.
0 commit comments