perf: Booker bundle size optimization - Remove sanitize-html dependency on client (#10801)
This commit is contained in:
1 parent
7c23773636
commit
a09401c203
8 files changed
+17
-26
No files matched your search
@@ -2,6 +2,12 @@ import sanitizeHtml from "sanitize-html";
|
||||
|
||||
import { md } from "@calcom/lib/markdownIt";
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
// This file imports markdown parser which is a costly dependency, so we want to make sure it's not imported on the client side.
|
||||
// It is still imported at some places on client in non-booker pages, we can gradually remove it from there and then convert it into an error
|
||||
console.warn("`markdownToSafeHTML` should not be imported on the client side.");
|
||||
}
|
||||
|
||||
export function markdownToSafeHTML(markdown: string | null) {
|
||||
if (!markdown) return "";
|
||||
|
||||
|
||||
Reference in new issue
Block a user