Closed CrazyZhang3 closed 1 year ago
改了下,这样灵活性会不会更好?
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import type { PagesConfig } from '@uni-helper/vite-plugin-uni-pages'
import uniPages from '@uni-helper/vite-plugin-uni-pages'
declare module 'vite' {
interface UserConfig {
uniPages ?: PagesConfig
}
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
UniPages({
homePage: 'pages/index',
debug: true,
subPackages: ['src/pages-sub'],
configSource: [
{
files: 'vite.config',
async rewrite(config) {
const resolved = await (typeof config === 'function' ? config() : config)
return resolved?.UniPages
},
},
],
}),
uni(),
],
uniPages : {
globalStyle: {
navigationBarTextStyle: 'black',
navigationBarTitleText: 'uni-helper - vite.config.ts',
navigationBarBackgroundColor: '#F8F8F8',
backgroundColor: '#F8F8F8',
},
},
})
确实这样更灵活一点
Description 描述
添加configFile用于修改配置文件位置 ### Linked Issues 关联的 Issues #85 ### Additional context 额外上下文