kun-galgame-vue/vite.config.ts

30 lines
753 B
TypeScript
Raw Normal View History

2023-05-02 15:22:46 +00:00
import { PluginOption, defineConfig } from 'vite'
import path, { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
2023-05-02 09:44:23 +00:00
// 引入 Rollup Plugin Visualizer 打包可视化工具
2023-05-02 15:22:46 +00:00
import { visualizer } from 'rollup-plugin-visualizer'
2023-05-22 15:42:21 +00:00
// 引入 mock-js
2023-05-24 07:11:28 +00:00
// import { viteMockServe } from 'vite-plugin-mock'
2023-04-14 13:58:13 +00:00
// https://vitejs.dev/config/
export default defineConfig({
2023-05-24 07:11:28 +00:00
plugins: [vue(), visualizer() as PluginOption],
2023-04-20 08:04:08 +00:00
/* src 别名为 @ */
resolve: {
alias: {
2023-05-02 15:22:46 +00:00
'@': path.resolve(__dirname, './src'),
2023-04-20 08:04:08 +00:00
},
},
2023-05-02 15:22:46 +00:00
css: {
preprocessorOptions: {
2023-05-14 07:16:28 +00:00
less: {
javascriptEnabled: true,
additionalData: `@import "${resolve(
__dirname,
'./src/styles/theme/theme.less'
)}";`,
},
2023-05-02 15:22:46 +00:00
},
2023-05-14 07:16:28 +00:00
},
2023-05-02 15:22:46 +00:00
})