feat: add LMS web client
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { resolve } from 'node:path';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, '.', '');
|
||||
const rendererRoot = resolve(process.cwd(), 'src/lms-renderer');
|
||||
|
||||
return {
|
||||
base: env.VITE_PUBLIC_BASE_PATH ?? '/lms-web/',
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@lms-renderer': rendererRoot,
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 5177,
|
||||
proxy: {
|
||||
'/lms-api': {
|
||||
target: env.VITE_LMS_API_PROXY_TARGET ?? 'http://localhost:4400',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/lms-api/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user