一个简单的vue3+windi.css库
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.
 
 
 
 
 

38 lines
1.0 KiB

import { defineConfig, loadEnv } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { viteMockServe } from 'vite-plugin-mock'
import WindiCSS from 'vite-plugin-windicss'
// https://vitejs.dev/config/
export default ({ mode, command } : { mode: string, command: string}) => {
const config = <ImportMetaEnv>loadEnv(mode, process.cwd())
return defineConfig({
base: './',
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
alias: {
'@': path.resolve('./src'),
'$': path.resolve('./src/assets/script'),
'%': path.resolve('./src/assets/style'),
},
},
css: {
preprocessorOptions: {
less: {
additionalData: `@import (reference) "@/assets/style/global.less";`
},
},
},
plugins: [
vue(), WindiCSS(),
Components({
dts: true
}),
viteMockServe({
mockPath: 'mock'
}),
]
})
}