1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import path from 'path'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import AutoImport from 'unplugin-auto-import/vite'
- import Components from 'unplugin-vue-components/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- // import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
- import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
- // https://vitejs.dev/config/
- export default defineConfig({
- base: './',
- resolve: {
- alias: {
- '~/': `${path.resolve(__dirname, 'src')}/`
- }
- },
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@use "~/styles/element/index.scss" as *;`
- // `@import "~/styles/index.scss";`
- }
- }
- },
- server: {
- proxy: {
- '/api': {
- target: 'https://vr.hdlkeji.com/api/',
- changeOrigin: true,
- rewrite: path => path.replace(/^\/api/, ''),
- }
- }
- },
- plugins: [
- vue(),
- createSvgIconsPlugin({
- iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
- symbolId: 'icon-[dir]-[name]',
- }),
- AutoImport({
- resolvers: [ElementPlusResolver({
- importStyle: "sass"
- })]
- }),
- Components({
- resolvers: [ElementPlusResolver({
- importStyle: "sass"
- })]
- })
- ]
- })
|