Skip to content

Commit

Permalink
fix double registeration of byoc components
Browse files Browse the repository at this point in the history
  • Loading branch information
addy-pathania committed Jan 4, 2024
1 parent 0654d14 commit 3aff213
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +24,7 @@ const feaasPlugin = (nextConfig = {}) => {
}

return config;
}
},
});
};

Expand Down

0 comments on commit 3aff213

Please sign in to comment.