20 lines
572 B
JavaScript
20 lines
572 B
JavaScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
base: "./", // 确保资源路径是相对的,以便在 Electron 中加载
|
|
publicDir: "public", // 指定 public 目录
|
|
server: {
|
|
port: 5173,
|
|
},
|
|
assetsInclude: ["**/*.pdf", "**/pdf.worker.min.js"], // 确保 PDF 和 worker 文件被当作静态资源处理
|
|
build: {
|
|
rollupOptions: {
|
|
// 确保 worker 文件不被打包,而是作为独立文件
|
|
external: [],
|
|
},
|
|
},
|
|
});
|