Skip to content

feat(ssr-perf-check): check whether server side rendering is used #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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