53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
import Uni from '@uni-helper/plugin-uni'
|
||
import UniHelperComponents from '@uni-helper/vite-plugin-uni-components'
|
||
import UniHelperLayouts from '@uni-helper/vite-plugin-uni-layouts'
|
||
import UniHelperManifest from '@uni-helper/vite-plugin-uni-manifest'
|
||
import UniHelperPages from '@uni-helper/vite-plugin-uni-pages'
|
||
import { UniEchartsResolver } from 'uni-echarts/resolver'
|
||
import UnoCSS from 'unocss/vite'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import { defineConfig } from 'vite'
|
||
import UniPolyfill from 'vite-plugin-uni-polyfill'
|
||
|
||
// https://vitejs.dev/config/
|
||
export default defineConfig({
|
||
css: {
|
||
preprocessorOptions: {
|
||
scss: {
|
||
// 压制依赖包(uni-ui 等)的 Sass 旧 API / 全局函数弃用警告
|
||
silenceDeprecations: ['legacy-js-api', 'global-builtin', 'color-functions', 'import'],
|
||
},
|
||
},
|
||
},
|
||
plugins: [
|
||
// https://uni-helper.js.org/vite-plugin-uni-manifest
|
||
UniHelperManifest(),
|
||
// https://uni-helper.js.org/vite-plugin-uni-pages
|
||
UniHelperPages({
|
||
dts: 'src/uni-pages.d.ts',
|
||
homePage: 'pages/Ahome/index',
|
||
}),
|
||
// https://uni-helper.js.org/vite-plugin-uni-layouts
|
||
UniHelperLayouts(),
|
||
// https://uni-helper.js.org/vite-plugin-uni-components
|
||
UniHelperComponents({
|
||
dts: 'src/components.d.ts',
|
||
directoryAsNamespace: true,
|
||
resolvers: [UniEchartsResolver()],
|
||
}),
|
||
// https://uni-helper.js.org/plugin-uni
|
||
Uni(),
|
||
UniPolyfill(),
|
||
// https://github.com/antfu/unplugin-auto-import
|
||
AutoImport({
|
||
imports: ['vue', '@vueuse/core', 'uni-app'],
|
||
dts: 'src/auto-imports.d.ts',
|
||
dirs: ['src/composables', 'src/stores', 'src/utils'],
|
||
vueTemplate: true,
|
||
}),
|
||
// https://github.com/antfu/unocss
|
||
// see unocss.config.ts for config
|
||
UnoCSS(),
|
||
],
|
||
})
|