Skip to content
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

Fix double registration of byoc components #1707

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
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
Next Next commit
fix double registeration of byoc components
addy-pathania committed Jan 4, 2024
commit 3aff213ed23464b383f117dcea4262e9b9230c18
Original file line number Diff line number Diff line change
@@ -8,7 +8,14 @@ const feaasPlugin = (nextConfig = {}) => {
// Force use of CommonJS on the server for FEAAS SDK since JSS also uses CommonJS entrypoint to FEAAS SDK.
// This prevents issues arising due to FEAAS SDK's dual CommonJS/ES module support on the server (via conditional exports).
// See https://nodejs.org/api/packages.html#dual-package-hazard.
config.externals = [{ '@sitecore-feaas/clientside/react': 'commonjs @sitecore-feaas/clientside/react' }, ...config.externals];
config.externals = [
{
'@sitecore-feaas/clientside/react': 'commonjs @sitecore-feaas/clientside/react',
'@sitecore/byoc': 'commonjs @sitecore/byoc',
'@sitecore/byoc/react': 'commonjs @sitecore/byoc/react',
...config.externals,
},
];
}

// Overload the Webpack config if it was already overloaded
@@ -17,7 +24,7 @@ const feaasPlugin = (nextConfig = {}) => {
}

return config;
}
},
});
};