1234567891011121314151617181920212223242526272829303132333435 |
- import { defineConfig, loadEnv } from 'vite'
- import path from 'path'
- import createVitePlugins from './vite/plugins'
- export default defineConfig(({ mode, command }) => {
- const env = loadEnv(mode, process.cwd())
- return {
- plugins: createVitePlugins(env, command === 'build'),
- resolve: {
-
- alias: {
-
- '~': path.resolve(__dirname, './'),
-
- '@': path.resolve(__dirname, './src')
- },
-
- extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
- },
-
- server: {
- port: 80,
- open: true,
- proxy: {
-
- '/dev-api': {
- target: 'http://localhost:8080',
- changeOrigin: true,
- rewrite: (p) => p.replace(/^\/dev-api/, '')
- }
- },
- },
- }
- })
|