1 Star 0 Fork 0

zhangsan/preview-pro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
import { defineConfig } from 'vite'
import pkg from './package.json'
import vue from '@vitejs/plugin-vue'
import PkgConfig from 'vite-plugin-package-config'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import OptimizationPersist from 'vite-plugin-optimize-persist'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
// https://vitejs.dev/config/
export default defineConfig({
define: {
PKG: JSON.stringify(pkg.dependencies),
},
plugins: [
vue(),
AutoImport({
dts: 'src/auto-imports.d.ts',
imports: ['vue', 'vue-router'],
}),
Components({
dts: 'src/components.d.ts',
deep: true,
dirs: ['src/components'],
extensions: ['vue', 'tsx'],
resolvers: [
AntDesignVueResolver({
importStyle: 'less',
importLess: true,
}),
],
}),
PkgConfig(),
OptimizationPersist(),
],
css: {
preprocessorOptions: {
less: {
// DO NOT REMOVE THIS LINE
javascriptEnabled: true,
modifyVars: {
// hack: `true; @import 'ant-design-vue/es/style/themes/default.less'`, // dark.less
'@primary-color': '#52c41a', // 全局主色
}
},
},
},
optimizeDeps: {
include: ['@ant-design/icons-vue', 'ant-design-vue'],
},
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangsan25486/preview-pro.git
git@gitee.com:zhangsan25486/preview-pro.git
zhangsan25486
preview-pro
preview-pro
3x

搜索帮助