import { defineConfig, splitVendorChunkPlugin } from "vite"; import react from "@vitejs/plugin-react"; import Pages from "vite-plugin-pages"; import { VitePWA } from "vite-plugin-pwa"; import reactRefresh from "@vitejs/plugin-react-refresh"; import monacoEditorPlugin from "vite-plugin-monaco-editor"; // import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill"; import appConfig from "./src/config"; //import viteCompression from "vite-plugin-compression"; // import eslintPlugin from "vite-plugin-eslint"; const base = appConfig.base ? "/" + appConfig.base + "/" : undefined; // https://vitejs.dev/config/ export default defineConfig({ publicDir: "public", build: { //base, }, base, plugins: [ react(), Pages({ caseSensitive: false, }), VitePWA({ registerType: "autoUpdate", // devOptions: { // enabled: true, // }, }), splitVendorChunkPlugin(), reactRefresh(), // NodeGlobalsPolyfillPlugin({ // buffer: true, // }), monacoEditorPlugin, // viteCompression({ // // deleteOriginFile: true, // filter: /\.(js|mjs|json|css)$/i, // }), // eslintPlugin(), ], resolve: { alias: [{ find: "~", replacement: "/src" }], }, define: { "process.env": {}, }, });