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.
37 lines
1018 B
37 lines
1018 B
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'),
|
|
'@util': path.resolve('./src/assets/script/util'),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
additionalData: `@import (reference) "@/assets/style/global.less";`
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
vue(), WindiCSS(),
|
|
Components({
|
|
dts: true
|
|
}),
|
|
viteMockServe({
|
|
mockPath: 'mock'
|
|
}),
|
|
]
|
|
})
|
|
}
|
|
|