mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-09-22 00:01:30 +00:00
- 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.
67 lines
1.4 KiB
TypeScript
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"],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}));
|