mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-18 20:30:08 +08:00
Introduced a new eslint.config.js using neostandard and added related devDependencies. Updated codebase for consistent formatting, spacing, and function declarations. Minor refactoring and cleanup across multiple files to improve readability and maintain code style compliance.
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import react from '@vitejs/plugin-react';
|
|
import path from 'node:path';
|
|
import { defineConfig, loadEnv, normalizePath } from 'vite';
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
const monacoEditorPath = normalizePath(
|
|
path.resolve(__dirname, 'node_modules/monaco-editor/min/vs')
|
|
);
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd());
|
|
const backendDebugUrl = env.VITE_DEBUG_BACKEND_URL;
|
|
console.log('backendDebugUrl', backendDebugUrl);
|
|
return {
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths(),
|
|
viteStaticCopy({
|
|
targets: [
|
|
{
|
|
src: monacoEditorPath,
|
|
dest: 'monaco-editor/min',
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
base: '/webui/',
|
|
server: {
|
|
proxy: {
|
|
'/api/ws/terminal': {
|
|
target: backendDebugUrl,
|
|
ws: true,
|
|
changeOrigin: true,
|
|
},
|
|
'/api': backendDebugUrl,
|
|
'/files': backendDebugUrl,
|
|
},
|
|
},
|
|
build: {
|
|
assetsInlineLimit: 0,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'monaco-editor': ['monaco-editor'],
|
|
'react-dom': ['react-dom'],
|
|
'react-router-dom': ['react-router-dom'],
|
|
'react-hook-form': ['react-hook-form'],
|
|
'react-icons': ['react-icons'],
|
|
'react-hot-toast': ['react-hot-toast'],
|
|
qface: ['qface'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|