41 lines
933 B
JavaScript
41 lines
933 B
JavaScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import tailwindcss from 'tailwindcss';
|
|
import autoprefixer from 'autoprefixer';
|
|
import path from 'path';
|
|
import nesting from 'tailwindcss/nesting';
|
|
|
|
const root = '/Users/xion/kevisual/dev-app/dev-app-page';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
root: root,
|
|
plugins: [react()],
|
|
css: {
|
|
postcss: {
|
|
plugins: [nesting, tailwindcss, autoprefixer],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.join(root, './src'),
|
|
},
|
|
},
|
|
define: {
|
|
DEV_SERVER: JSON.stringify(process.env.NODE_ENV === 'development'),
|
|
},
|
|
base: './',
|
|
server: {
|
|
port: 6005,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:9998',
|
|
// target: 'https://kevisual.xiongxiao.me',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '/api'),
|
|
},
|
|
},
|
|
},
|
|
});
|