Files
nyaterm/vite.config.ts
Kang a369feb797 chore(deps): add xterm image addon to package and configuration
- Added the `@xterm/addon-image` dependency to `package.json` to enhance terminal capabilities with image support.
- Updated `pnpm-lock.yaml` to include the new addon version and its dependencies.
- Modified `vite.config.ts` to integrate the image addon into the terminal setup.
2026-08-23 15:20:45 +08:00

67 lines
1.4 KiB
TypeScript

import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import browserslist from "browserslist";
import { browserslistToTargets } from "lightningcss";
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [react(), tailwindcss()],
css: {
transformer: "lightningcss",
lightningcss: {
targets: browserslistToTargets(browserslist("safari >= 14, chrome >= 105")),
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
test: {
environment: "jsdom",
setupFiles: "./src/test/setup.ts",
},
clearScreen: false,
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
ignored: ["**/src-tauri/**"],
},
},
build: {
cssMinify: "lightningcss",
rollupOptions: {
output: {
manualChunks: {
react: ["react", "react-dom"],
xterm: [
"@xterm/xterm",
"@xterm/addon-fit",
"@xterm/addon-image",
"@xterm/addon-web-links",
"@xterm/addon-webgl",
"@xterm/addon-search",
],
tauri: ["@tauri-apps/api"],
},
},
},
},
}));