55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import UnoCSS from 'unocss/vite'
|
|
import {defineConfig,loadEnv} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import {AntDesignVueResolver, VantResolver} from 'unplugin-vue-components/resolvers'
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import {fileURLToPath, URL} from "node:url"
|
|
import {resolve} from "pathe"
|
|
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueJsx(),
|
|
UnoCSS({
|
|
configFile: './uno.config.ts',
|
|
}),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
resolve: {
|
|
extensions: ['*', '.js', '.vue', '.json', '.ts', '.tsx', '.mjs'],
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
'@assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
|
|
'~': fileURLToPath(new URL('./node_modules', import.meta.url)),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
modifyVars: {
|
|
// Used for global import to avoid the need to import each style file separately
|
|
// reference: Avoid repeated references
|
|
hack: ` ; @import (reference) "${resolve('./src/assets/css/var.less')}"`,
|
|
},
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
sourcemap: false,
|
|
},
|
|
server: {
|
|
port: 3444
|
|
},
|
|
base:'/',
|
|
|
|
})
|