| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import { resolve } from 'path'
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [vue()],
- resolve: {
- alias: { //
- '@': resolve(__dirname, 'src'),
- //remove i18n waring
- },
- // why remove it , look for https://github.com/vitejs/vite/issues/6026
- // extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.mjs']
- },
- server: {
- host: '0.0.0.0',
- open: true,
- proxy: {
- // 跨域前缀写法
- '/api': {
- target: 'http://localhost:5000',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ''),
- },
- },
- },
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: "@import '@/assets/scss/_index.scss';",
- },
- },
- },
- })
- // function __dirname(__dirname: any, arg1: string): string {
- // throw new Error('Function not implemented.')
- // }
|