f
This commit is contained in:
72
vite.config.js
Normal file
72
vite.config.js
Normal file
@@ -0,0 +1,72 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import Components from '@uni-helper/vite-plugin-uni-components'
|
||||
import { ZPagingResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
|
||||
import { UniEchartsResolver } from 'uni-echarts/resolver'
|
||||
import UniPages from '@uni-helper/vite-plugin-uni-pages'
|
||||
import UniLayouts from '@uni-helper/vite-plugin-uni-layouts'
|
||||
import UniManifest from '@uni-helper/vite-plugin-uni-manifest'
|
||||
import UniPlatform from '@uni-helper/vite-plugin-uni-platform'
|
||||
import UniRoot from '@uni-ku/root'
|
||||
import ComponentPlaceholder from '@binbinji/vite-plugin-component-placeholder'
|
||||
import { UniEcharts } from 'uni-echarts/vite'
|
||||
import Uni from '@uni-helper/plugin-uni'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 5173,
|
||||
strictPort: false,
|
||||
// 与 tyc-webview-v2 一致:H5 开发时将 /api/v1 代理到线上网关(本地可改 target)
|
||||
proxy: {
|
||||
'/api/v1': {
|
||||
// target: 'https://www.tianyuancha.cn',
|
||||
target: 'http://127.0.0.1:8888',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
// https://uni-helper.js.org/vite-plugin-uni-components
|
||||
Components({
|
||||
dts: true,
|
||||
resolvers: [UniEchartsResolver(), ZPagingResolver()]
|
||||
}),
|
||||
// https://uni-helper.js.org/vite-plugin-uni-pages
|
||||
UniPages(),
|
||||
// https://uni-helper.js.org/vite-plugin-uni-layouts
|
||||
UniLayouts(),
|
||||
// https://uni-helper.js.org/vite-plugin-uni-manifest
|
||||
UniManifest(),
|
||||
// https://uni-helper.js.org/vite-plugin-uni-platform
|
||||
UniPlatform(),
|
||||
// https://github.com/uni-ku/root
|
||||
UniRoot(),
|
||||
// https://github.com/chouchouji/vite-plugin-component-placeholder
|
||||
ComponentPlaceholder(),
|
||||
// https://uni-echarts.xiaohe.ink
|
||||
UniEcharts(),
|
||||
// https://uni-helper.js.org/plugin-uni
|
||||
Uni(),
|
||||
UnoCSS(),
|
||||
],
|
||||
build: {
|
||||
target: "es6",
|
||||
cssTarget: "chrome61"
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: [
|
||||
"vue-demi",
|
||||
"uni-echarts"
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user