We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
如上图所示,微信小程序darkmode的适配需要在page.json中开启darkmode,但是我在 接口定义PagesConfig 中没有找到相关定义;
darkmode
接口定义PagesConfig
但是发现此字段是允许 [x: string]: any 的,于是就自行添加了此配置,但是发现并没有出现在自动生成的 page.json 中。
[x: string]: any
page.json
希望能支持自定义加入额外自定义配置项,或者将 darkmode 配置项加入到 接口定义PagesConfig 中,且能够如愿出现在page.json中。
// page.config.ts import { defineUniPages } from "@uni-helper/vite-plugin-uni-pages" export default defineUniPages({ // more // ... darkmode: true, // more // ... })
以上 darkmode: true 为需要额外加入到page.json配置项,但是没有如愿加入。
darkmode: true
System: OS: Windows 10 10.0.19044 CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor Memory: 43.60 GB / 63.21 GB Binaries: Node: 18.18.2 - D:\Environment\NodeJs\node.EXE Yarn: 1.22.21 - D:\Environment\NodeJs\yarn.CMD npm: 10.2.5 - D:\Environment\NodeJs\npm.CMD pnpm: 8.14.0 - D:\Environment\NodeJs\pnpm.CMD Browsers: Edge: Chromium (122.0.2365.80) Internet Explorer: 11.0.19041.3636
pnpm
The text was updated successfully, but these errors were encountered:
https://github.com/uni-helper/vitesse-uni-app/blob/main/manifest.config.ts#L60
有没有可能,darkmode 是这样开启的?
Sorry, something went wrong.
是的 大佬说的没错 是我疏忽了
后面发现了此问题的原因: 以上问题的出现是因为项目特殊原因,每次启动前都会吧manifest.json的文件内容清空,这就导致了 vite-plugin-uni-manifest 插件没有及时生成 manifest.json 文件的时候 vite-plugin-uni-pages 插件就产生效力了,导致读取不到 manifest.json 的内容;
manifest.json
vite-plugin-uni-manifest
vite-plugin-uni-pages
尝试过在 vite.config.ts 中将 vite-plugin-uni-manifest 插件的顺序提到最前面,也是如此(我理想中该插件提到最前面的时候,能先生成manifest.json,然后 vite-plugin-uni-pages 产生效力的时候就能有内容可读取,但是并没有如我想象中那样);
vite.config.ts
基于以上,我想我的问题有两个办法可以解决:
echo {}> src/manifest.json
解决办法1:最终将 echo {}> src/manifest.json 操作改为了:
{ "scripts": { "reset:manifest": "node -e \"var fs = require('fs'); if (!fs.existsSync('src/manifest.json')) fs.writeFileSync('src/manifest.json', '{}');\"", }, }
No branches or pull requests
描述问题
如上图所示,微信小程序darkmode的适配需要在page.json中开启
darkmode
,但是我在接口定义PagesConfig
中没有找到相关定义;但是发现此字段是允许
[x: string]: any
的,于是就自行添加了此配置,但是发现并没有出现在自动生成的page.json
中。期望:
希望能支持自定义加入额外自定义配置项,或者将
darkmode
配置项加入到接口定义PagesConfig
中,且能够如愿出现在page.json中。复现
以上
darkmode: true
为需要额外加入到page.json配置项,但是没有如愿加入。系统信息
使用的包管理器
pnpm
核对
The text was updated successfully, but these errors were encountered: