Improve building of twenty-sdk (#17913)
## Split twenty-sdk build into separate Node and browser targets The SDK was bundling Node.js code (CLI, SDK API) and browser code (UI components, front-component renderer) through a single Vite config. This caused incorrect externalization — Node builtins leaked into browser bundles and browser-specific chunking logic applied to CLI output. This PR splits the build into `vite.config.node.ts` and `vite.config.browser.ts` so each target gets the right externals and output format. Also includes a few housekeeping renames: - `front-component` export path → `front-component-renderer` (matches what it actually is) - `front-component-common` merged into `front-component-api` (was a needless extra module)
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
type FrontComponentErrorEffectProps = {
|
||||
error: Error | null;
|
||||
onError: (error: Error) => void;
|
||||
};
|
||||
export const FrontComponentErrorEffect = ({
|
||||
error,
|
||||
onError,
|
||||
}: FrontComponentErrorEffectProps) => {
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
onError(error);
|
||||
}
|
||||
}, [error, onError]);
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user