Files
AboveTheMark/vite.config.js

39 lines
1017 B
JavaScript
Raw Normal View History

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { viteSingleFile } from 'vite-plugin-singlefile';
2026-10-20 20:17:01 -04:00
// Build modes: single-file, iwa (Installer for Web Applications), or default/pwa
const singleFile = process.env.SINGLEFILE === '1';
2026-10-20 20:17:01 -04:00
const iwaBuild = process.env.IWA === '1';
export default defineConfig({
plugins: [react(), ...(singleFile ? [viteSingleFile()] : [])],
server: {
host: true,
port: 3000
},
build: {
target: 'esnext',
outDir: 'dist',
sourcemap: false,
minify: 'terser',
// Inline every asset (including KaTeX fonts) as data URIs for the single file.
assetsInlineLimit: singleFile ? 100_000_000 : 4096,
2026-10-20 20:17:01 -04:00
cssCodeSplit: !(singleFile || iwaBuild),
chunkSizeWarningLimit: singleFile ? 6000 : 500
},
optimizeDeps: {
include: [
'@uiw/react-md-editor',
'katex',
'lucide-react',
'docx',
'mammoth',
'marked',
'rehype-katex',
'remark-math',
'file-saver'
]
}
});