7
0
Fork 0
YouchuYoukuh5/vite.config.js

23 lines
816 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import UniPages from '@uni-helper/vite-plugin-uni-pages'
import UnoCSS from 'unocss/vite'
// https://vitejs.dev/config/
import getPages from './build'
const exclude = getPages()
export default defineConfig({
plugins: [
UniPages({
exclude: ['**/components/**/**.*',...exclude],
routeBlockLang: 'json5', // 虽然设了默认值但是vue文件还是要加上 lang="json5", 这样才能很好地格式化
// homePage 通过 vue 文件的 route-block 的type="home"来设定
// pages 目录为 src/pages分包目录不能配置在pages目录下
// subPackages: ['src/pages-sub'], // 是个数组可以配置多个但是不能为pages里面的目录
}),
uni(),
UnoCSS(),
],
})