diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..c2ebb512df --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +public-hoist-pattern[]=react +public-hoist-pattern[]=react-dom diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index c0507704c5..c44905b056 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -23,15 +23,25 @@ const config = defineConfig(() => ({ crawlLinks: true, autoStaticPathsDiscovery: true, filter: ({ path }) => { + const dynamicRoutes = [ + "/api", + "/webhook", + "/app", + "/callback", + "/t", + "/new", + ]; + const externalRedirectRoutes = [ + "/download/linux-deb", + "/download/linux-appimage", + "/download/windows", + "/download/apple-silicon", + "/download/apple-intel", + ]; return ( - path === "/" || - path.startsWith("/blog") || - path.startsWith("/docs") || - path.startsWith("/changelog") || - path.startsWith("/legal") || - path.startsWith("/product") || - path.startsWith("/pricing") || - path === "/enterprise" + !dynamicRoutes.some( + (route) => path === route || path.startsWith(route + "/"), + ) && !externalRedirectRoutes.includes(path) ); }, }, @@ -42,6 +52,7 @@ const config = defineConfig(() => ({ ], ssr: { noExternal: ["posthog-js", "@posthog/react", "react-tweet"], + external: ["turndown"], }, }));