diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aff92cd..272c49c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: oven-sh/setup-bun@v1 - run: bun install - - run: bun vite build + - run: bun vite build --base="/llm-workbench/" - uses: actions/upload-pages-artifact@v2 with: path: "dist" diff --git a/bun.lockb b/bun.lockb index e5a02d7..b3773e0 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 4a2136f..168f41a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^20.8.9", "@types/react": "^18.2.33", + "@types/react-dom": "^18.2.14", "autoprefixer": "^10.4.16", "bun-types": "latest", "postcss": "^8.4.31", diff --git a/src/index.tsx b/src/index.tsx index 6553549..55476a3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -26,3 +26,5 @@ ReactDOM.createRoot(document.getElementById("root")!).render( onSnapshot(store, (snapshot) => { window.localStorage.setItem("store", JSON.stringify(snapshot)) }) + +console.log("Initialized") diff --git a/src/lib/extraction.ts b/src/lib/extraction.ts index 61f8852..265095d 100644 --- a/src/lib/extraction.ts +++ b/src/lib/extraction.ts @@ -18,12 +18,11 @@ async function extractWithMammoth(file: File) { return result.value } -// import pdfParse from "pdf-parse" -const pdfjs = await import("pdfjs-dist/build/pdf") -const pdfjsWorker = await import("pdfjs-dist/build/pdf.worker.entry") -pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker - async function extractWithPDFParse(file: File) { + const pdfjs = await import("pdfjs-dist/build/pdf") + const pdfjsWorker = await import("pdfjs-dist/build/pdf.worker.entry") + pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker + async function getDoc(file) { const arrayBuffer = await readFileInputEventAsArrayBuffer(file) const result = await pdfjs.getDocument({ diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/vite.config.js b/vite.config.js index 31c62b4..5790e82 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,10 +3,6 @@ import react from "@vitejs/plugin-react" import { defineConfig } from "vite" export default defineConfig({ - base: "/llm-workbench/", - build: { - target: 'esnext' - }, plugins: [react()], resolve: { alias: {