chore: update package.json + vite.config.ts
This commit is contained in:
+17
-19
@@ -5,29 +5,27 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"build": "tsc -b && vite build && npm run postbuild",
|
||||
"postbuild": "mkdir -p dist/pdf-worker dist/cmaps && cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs dist/pdf-worker/ && cp node_modules/pdfjs-dist/cmaps/* dist/cmaps/",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^19.2.7",
|
||||
"react-dom": "^19.2.7",
|
||||
"react-pdf": "^11.0.0",
|
||||
"react-router-dom": "^7.18.1"
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-pdf": "^10.0.0",
|
||||
"react-router-dom": "^7.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/node": "^24.13.2",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^6.0.3",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
"globals": "^17.7.0",
|
||||
"typescript": "~6.0.2",
|
||||
"typescript-eslint": "^8.62.0",
|
||||
"vite": "^8.1.1",
|
||||
"vite-plugin-static-copy": "^4.1.1"
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@types/react": "^19.1.16",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.22",
|
||||
"globals": "^16.4.0",
|
||||
"typescript": "~5.9.3",
|
||||
"typescript-eslint": "^8.45.0",
|
||||
"vite": "^8.1.5"
|
||||
}
|
||||
}
|
||||
+2
-24
@@ -1,32 +1,10 @@
|
||||
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(),
|
||||
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',
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
plugins: [react()],
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1000,
|
||||
chunkSizeWarningLimit: 1600,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user