kun-galgame-vue/vite.config.ts
2023-05-22 23:42:21 +08:00

30 lines
767 B
TypeScript

import { PluginOption, defineConfig } from 'vite'
import path, { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
// 引入 Rollup Plugin Visualizer 打包可视化工具
import { visualizer } from 'rollup-plugin-visualizer'
// 引入 mock-js
import { viteMockServe } from 'vite-plugin-mock'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), visualizer() as PluginOption, viteMockServe()],
/* src 别名为 @ */
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `@import "${resolve(
__dirname,
'./src/styles/theme/theme.less'
)}";`,
},
},
},
})