Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
68 lines
2.0 KiB
TypeScript
68 lines
2.0 KiB
TypeScript
import path, { dirname } from 'node:path'
|
||
import { fileURLToPath } from 'node:url'
|
||
|
||
import { defineConfig } from '@vben/vite-config'
|
||
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||
|
||
export default defineConfig(async () => {
|
||
return {
|
||
application: {
|
||
injectGlobalScss: false,
|
||
},
|
||
vite: {
|
||
css: {
|
||
preprocessorOptions: {
|
||
scss: {
|
||
additionalData: `
|
||
@use "styles/theme.scss" as *;
|
||
@use "styles/variate.scss" as *;
|
||
`,
|
||
api: 'modern',
|
||
loadPaths: [path.resolve(__dirname, './src')],
|
||
},
|
||
},
|
||
},
|
||
server: {
|
||
port: 2345,
|
||
host: '0.0.0.0',
|
||
open: true,
|
||
proxy: {
|
||
'/api': {
|
||
target: 'http://43.136.52.196:9053',
|
||
// target: 'https://admin.xuexiaole.com',
|
||
changeOrigin: true,
|
||
},
|
||
},
|
||
},
|
||
plugins: [
|
||
AutoImport({
|
||
// 自动导入Vue相关函数,如ref, reactive等
|
||
imports: ['vue', 'vue-router', 'pinia'],
|
||
// 可以选择auto-import.d.ts生成的位置,使用ts建议设置为'src/auto-import.d.ts'
|
||
dts: 'src/auto-import.d.ts',
|
||
// 自动导入目录下的模块
|
||
dirs: ['src/store'],
|
||
// 自动导入的API
|
||
vueTemplate: true,
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
Components({
|
||
// 自动导入组件目录
|
||
dirs: ['src/components'],
|
||
// 组件的有效文件扩展名
|
||
extensions: ['vue'],
|
||
// 配置type文件生成位置,使用ts建议设置为'src/components.d.ts'
|
||
dts: 'src/components.d.ts',
|
||
// 自动导入组件库解析器
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
],
|
||
},
|
||
}
|
||
})
|