见上

- 发布:2025-06-25 16:50
- 更新:2025-06-25 17:01
- 阅读:90
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 123
HBuilderX类型: Alpha
HBuilderX版本号: 4.72
第三方开发者工具版本号: 123
基础库版本号: 123
项目创建方式: HBuilderX
操作步骤:
预期结果:
有 watchOptions
有 watchOptions
实际结果:
无 watchOptions
无 watchOptions
bug描述:
mainfest.json 下 mp-weixin 配置 watchOptions 和 packOptions,packOptions 生效了,watchOptions没生效
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"bigPackageSizeSupport": false,
"minifyWXML": true,
"useCompilerPlugins": [
"typescript",
"less"
]
},
"watchOptions": {
"ignore": [
"utils/util.js",
"libs/**/**"
]
},
"scripts": {},
"debugOptions": {},
"packOptions": {
"ignore": [{
"type": "file",
"value": "test/test.js"
}, {
"type": "folder",
"value": "test"
}, {
"type": "suffix",
"value": ".webp"
}, {
"type": "prefix",
"value": ""
}, {
"type": "glob",
"value": "test/**/*.js"
}, {
"type": "regexp",
"value": "\\.jsx$"
}]
},
"requiredBackgroundModes": ["audio"],
"mergeVirtualHostAttributes": true,
"usingComponents": true,
"resizable": true
},
打包之后 project.config.json 没有 watchOptions
{
"description": "项目配置文件。",
"packOptions": {
"ignore": [
{
"type": "file",
"value": "test/test.js"
},
{
"type": "folder",
"value": "test"
},
{
"type": "suffix",
"value": ".webp"
},
{
"type": "prefix",
"value": ""
},
{
"type": "glob",
"value": "test/**/*.js"
},
{
"type": "regexp",
"value": "\\.jsx$"
}
]
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": false,
"newFeature": true,
"bigPackageSizeSupport": false,
"minifyWXML": true,
"useCompilerPlugins": [
"typescript",
"less"
]
},
"compileType": "miniprogram",
"libVersion": "",
"appid": "touristappid",
"projectname": "332342344",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
},
"debugOptions": {},
"scripts": {}
}
1 个回复
DCloud_UNI_JBB
感谢反馈,问题已复现,已加分。
临时解决方案
替换 /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli-vite/node_modules/@dcloudio/uni-cli-shared/dist/json/mp/project.js 为附件文件