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' // https://vitejs.dev/config/ export default defineConfig({ resolve: { alias: { '~/': `${path.resolve(__dirname, 'src')}/` } }, css: { preprocessorOptions: { scss: { additionalData: `@use "~/styles/element/index.scss" as *;` // `@import "~/styles/index.scss";` } } }, 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" })] }) ] })