加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
桥头的小屁孩 提交于 2022-11-23 18:56 . first commit
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
import eslintPlugin from 'vite-plugin-eslint'
import { resolve } from 'path'
import optimizer from 'vite-plugin-optimizer'
import { devPlugin, getReplacer } from './plugins/devPlugin'
import { buildPlugin } from './plugins/buildPlugin'
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
plugins: [buildPlugin()]
}
},
plugins: [
optimizer(getReplacer()),
devPlugin(),
vue(),
eslintPlugin({
include: ['src/**/*.js', 'src/**/*.ts'],
exclude: ['./node_modules/**'],
// failOnWarning: true,
cache: false
}),
VueSetupExtend(),
AutoImport({
dts: 'src/render/auto-imports.d.ts',
imports: ['vue', 'vue-router'],
resolvers: [ElementPlusResolver()],
eslintrc: {
enabled: true,
filepath: './.eslintrc-auto-import.json',
globalsPropValue: true
}
}),
Components({
resolvers: [ElementPlusResolver()]
})
],
resolve: {
alias: {
'@': resolve(__dirname, './', 'src/')
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/assets/style/global.scss" as *;`
}
}
},
base: './'
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化