Progressively rebuild when files change

This commit is contained in:
Alex Gleason committed 2025-11-04 17:22:12 -06:00
1 parent adc4dd19b7
commit ef6962d7c7
8 files changed
+225 -6

No files matched your search

+8
View File
@@ -19,6 +19,7 @@ import { StarButton } from '@/components/StarButton';
import { useBuildProject } from '@/hooks/useBuildProject';
import { useIsProjectPreviewable } from '@/hooks/useIsProjectPreviewable';
import { useConsoleError } from '@/hooks/useConsoleError';
import { useAutoBuild } from '@/hooks/useAutoBuild';
export function ProjectView() {
const { projectId } = useParams<{ projectId: string }>();
@@ -43,6 +44,13 @@ export function ProjectView() {
const build = useBuildProject(projectId!);
const { data: isPreviewable = false } = useIsProjectPreviewable(projectId!);
// Enable auto-build for previewable projects
useAutoBuild({
projectId: projectId!,
enabled: isPreviewable,
debounceMs: 2000,
});
const loadProject = useCallback(async () => {
if (!projectId) return;