Files
kv-md/vite.config.ts
abearixong 8ca7efcf6d feat: add AI command suggestions extension for Tiptap editor
- Implemented Commands plugin to handle command suggestions triggered by '@' character.
- Created suggestion configuration to filter and render command items.
- Added various command items including date, time, formatting, templates, and task management commands.
- Introduced CSS styles for the Tiptap editor to enhance UI.
- Configured TypeScript settings and Vite build for the project.
2025-12-17 13:48:51 +08:00

45 lines
1.2 KiB
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import pkgs from './package.json';
import tailwindcss from '@tailwindcss/vite';
import dotenv from 'dotenv';
dotenv.config();
const isDev = process.env.NODE_ENV === 'development';
const plugins = [react(), tailwindcss()];
let target = process.env.VITE_API_URL || 'http://localhost:51015';
const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' };
let proxy = {
'/root/': apiProxy,
'/api': apiProxy,
'/client': apiProxy,
};
const ENV_BASE_NAME = process.env.BASE_NAME;
const _basename = ENV_BASE_NAME || pkgs.basename;
const basename = isDev ? undefined : `${_basename}`;
/**
* @see https://vitejs.dev/config/
*/
export default defineConfig(() => {
return {
plugins,
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
base: basename,
define: {
BASE_NAME: JSON.stringify(basename),
BUILD_TIME: JSON.stringify(new Date().toISOString()),
},
server: {
port: 7008,
host: '0.0.0.0',
proxy,
},
};
});