You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
import { defineConfig } from 'vite' |
|
import vue from '@vitejs/plugin-vue' |
|
import AutoImport from 'unplugin-auto-import/vite' |
|
import svgLoader from 'vite-svg-loader' |
|
import path from 'path' |
|
import Components from 'unplugin-vue-components/vite' |
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' |
|
|
|
// https://vitejs.dev/config/ |
|
export default defineConfig({ |
|
base: '/pc/', |
|
plugins: [ |
|
vue(), |
|
svgLoader(), |
|
AutoImport({ |
|
imports: [ |
|
'vue', 'vue-router' |
|
], |
|
resolvers: [ElementPlusResolver()], |
|
}), |
|
Components({ |
|
resolvers: [ElementPlusResolver({ |
|
importStyle: "sass" |
|
})], |
|
}), |
|
], |
|
resolve: { |
|
// https://cn.vitejs.dev/config/#resolve-alias |
|
alias: { |
|
// 设置路径 |
|
'~': path.resolve(__dirname, './'), |
|
// 设置别名 |
|
'@': path.resolve(__dirname, './src/') |
|
}, |
|
// https://cn.vitejs.dev/config/#resolve-extensions |
|
extensions: ['.js'] |
|
}, |
|
css: { |
|
preprocessorOptions: { |
|
scss: { |
|
additionalData: `@use "src/assets/style/theme.scss" as *;` |
|
}, |
|
}, |
|
}, |
|
server: { |
|
host: '0.0.0.0', |
|
port: 5174, |
|
proxy: { |
|
'/api': { |
|
// https://jzxx.biutag.com/api |
|
// http://127.0.0.1:8080 |
|
target: 'http://127.0.0.1:8080', |
|
changeOrigin: true, |
|
rewrite: (p) => p.replace(/^\/api/, '') |
|
} |
|
} |
|
} |
|
})
|
|
|