File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
packages/nextjs-mf/src/plugins/NextFederationPlugin Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @module-federation/nextjs-mf ' : patch
3+ ---
4+
5+ Prevent application from compiling if AppDir is used at all
Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ export class NextFederationPlugin {
8080 }
8181
8282 private validateOptions ( compiler : Compiler ) : boolean {
83+ const manifestPlugin = compiler . options . plugins . find (
84+ ( p ) => p ?. constructor . name === 'BuildManifestPlugin' ,
85+ ) ;
86+
87+ if ( manifestPlugin ) {
88+ //@ts -ignore
89+ if ( manifestPlugin ?. appDirEnabled ) {
90+ throw new Error (
91+ 'App Directory is not supported by nextjs-mf. Use only pages directory, do not open git issues about this' ,
92+ ) ;
93+ }
94+ }
95+
8396 const compilerValid = validateCompilerOptions ( compiler ) ;
8497 const pluginValid = validatePluginOptions ( this . _options ) ;
8598 const envValid = process . env [ 'NEXT_PRIVATE_LOCAL_WEBPACK' ] ;
@@ -109,6 +122,7 @@ export class NextFederationPlugin {
109122 if ( this . _extraOptions . debug ) {
110123 compiler . options . devtool = false ;
111124 }
125+
112126 if ( isServer ) {
113127 configureServerCompilerOptions ( compiler ) ;
114128 configureServerLibraryAndFilename ( this . _options ) ;
You can’t perform that action at this time.
0 commit comments