import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' import VueSetupExtend from 'vite-plugin-vue-setup-extend'; import { fileURLToPath, URL } from 'node:url'; // import path from 'node:path'; // https://vite.dev/config/ export default defineConfig((command, mode) => { const env = loadEnv(mode, process.cwd(), ''); return { plugins: [vue(), VueSetupExtend()], base: './', define: { 'process.env': env }, css: { preprocessorOptions: { less: { javascriptEnabled: true } } }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) }, extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] }, server: { host: 'localhost', port: 5273 } } });