mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 21:15:18 +09:00
Seems like we no longer need commonjs in most packages. Only prisma cannot be bundled on server because has binary. Now new package setup is easier and require only esbuild instead of custom solution. Cli install size ```diff du -ck node_modules - 35516 + 33192 ```
Error utils
API
captureError(error, value)
- Provides a compile error when value is not
never - Throws a runtime error in development synchronously to break intentionally
- Throws an error in production asynchronously to not break unintentionally
import { captureError } from "error-utils";
const fn = (value: { type: string }) => {
if (value.type === "foo") {
return value;
}
return captureError(new Error("Should never happen"), value);
};