123456789101112131415161718192021222324252627282930313233343536373839 |
- import { defineConfig } from 'vite'
- import { resolve } from 'path';
- import vue from '@vitejs/plugin-vue'
- import ViteComponents from 'unplugin-vue-components/vite'
- import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
- const root = process.cwd()
- // https://vitejs.dev/config/
- export default defineConfig({
- root,
- css: {
- preprocessorOptions: {
- less: {
- // 解决antd 引入less报错
- javascriptEnabled: true,
- lessOptions: {
- modifyVars: {
- 'primary-color': '#a1c4fd'
- }
- }
- }
- }
- },
- resolve: {
- alias: [
- {
- find: /^@\//,
- replacement: resolve(root, './src') + '/'
- }
- ]
- },
- plugins: [
- vue(),
- ViteComponents({
- resolvers: [AntDesignVueResolver()],
- dts: true
- })
- ]
- })
|