Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions libs/native-federation-core/src/lib/core/build-for-federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,10 @@ export async function buildForFederation(
'browser'
);

const sharedPackageInfoServer = await bundleShared(
sharedServer,
config,
fedOptions,
externals,
'node'
);
// If SSR is not enabled, we can avoid bundling for the server.
const sharedPackageInfoServer = fedOptions.ssr
? await bundleShared(sharedServer, config, fedOptions, externals, 'node')
: [];

const separatePackageInfoBrowser = await bundleSeparate(
separateBrowser,
Expand All @@ -74,13 +71,16 @@ export async function buildForFederation(
'browser'
);

const separatePackageInfoServer = await bundleSeparate(
separateServer,
externals,
config,
fedOptions,
'node'
);
// If SSR is not enabled, we can avoid bundling for the server.
const separatePackageInfoServer = fedOptions.ssr
? await bundleSeparate(
separateServer,
externals,
config,
fedOptions,
'node'
)
: [];

sharedPackageInfoCache = [
...sharedPackageInfoBrowser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface FederationOptions {
verbose?: boolean;
dev?: boolean;
watch?: boolean;
ssr?: boolean;
packageJson?: string;
entryPoint?: string;
buildNotifications?: BuildNotificationOptions;
Expand Down
1 change: 1 addition & 0 deletions libs/native-federation/src/builders/build/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export async function* runBuilder(
verbose: options.verbose,
watch: false, // options.watch,
dev: !!nfOptions.dev,
ssr: !!nfOptions.ssr,
entryPoint,
buildNotifications: nfOptions.buildNotifications,
};
Expand Down
Loading
Loading