generated from coulomb/repo-seed
Compare commits
2 Commits
779ae0d317
...
d5474a1bd9
| Author | SHA1 | Date | |
|---|---|---|---|
| d5474a1bd9 | |||
| a5f5c7d8a8 |
23
Makefile
Normal file
23
Makefile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.PHONY: preview dev build test typecheck lint
|
||||||
|
|
||||||
|
# Build the production bundle then serve it locally with vite preview.
|
||||||
|
# Prints the URL (default http://localhost:4173/) once the server is ready.
|
||||||
|
preview:
|
||||||
|
pnpm build
|
||||||
|
pnpm preview
|
||||||
|
|
||||||
|
# Dev server with HMR (http://localhost:5173/).
|
||||||
|
dev:
|
||||||
|
pnpm dev
|
||||||
|
|
||||||
|
build:
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
test:
|
||||||
|
pnpm test
|
||||||
|
|
||||||
|
typecheck:
|
||||||
|
pnpm typecheck
|
||||||
|
|
||||||
|
lint:
|
||||||
|
pnpm lint
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
import { StrictMode } from "react";
|
import { StrictMode } from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
|
import * as pdfjs from "pdfjs-dist";
|
||||||
|
// Vite resolves `?url` to a bundled asset URL the browser can fetch.
|
||||||
|
import pdfWorkerUrl from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||||
|
|
||||||
import { App } from "./App";
|
import { App } from "./App";
|
||||||
|
|
||||||
|
// PDF.js needs a worker URL before any PDF is parsed. Set it once at app
|
||||||
|
// bootstrap so both the source-layer ingest (extract.ts) and the viewer
|
||||||
|
// adapter (PdfSpikeViewer) can open documents.
|
||||||
|
pdfjs.GlobalWorkerOptions.workerSrc = pdfWorkerUrl;
|
||||||
|
|
||||||
const container = document.getElementById("root");
|
const container = document.getElementById("root");
|
||||||
if (!container) throw new Error("#root not found");
|
if (!container) throw new Error("#root not found");
|
||||||
|
|
||||||
|
|||||||
1
src/vite-env.d.ts
vendored
Normal file
1
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
Reference in New Issue
Block a user