📄 Lectures: pdf.js viewer в модалке вместо Google Viewer

- vite.config.ts: копирование pdf.worker + cMaps
- LecturesPage.tsx: react-pdf viewer с навигацией по страницам
- Скачивание через Telegram.WebApp.downloadFile (без изменений)
- Убрал Google Docs Viewer — приватность
This commit is contained in:
2026-09-27 12:31:31 +03:00
parent f83028b105
commit b1756ec822
4 changed files with 899 additions and 55 deletions
+26 -4
View File
@@ -1,10 +1,32 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import path from 'node:path';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
viteStaticCopy({
targets: [
// pdf.worker.min.mjs — worker для pdf.js
{
src: path.join(pdfjsDistPath, 'build', 'pdf.worker.min.mjs'),
dest: 'pdf-worker',
},
// cMaps — для кириллицы и польских букв
{
src: path.join(pdfjsDistPath, 'cmaps', '*'),
dest: 'cmaps',
},
],
}),
],
build: {
chunkSizeWarningLimit: 1000,
},
})
});