一摸一样的配置,在开发者工具是ok的,使用cli命令生成预览码报错,CodeError: Error: {"errCode":-1,"errMsg":"inner test source fail with errcode: 80200, errmsg: main package source size 2097KB exceed max limit 2MB"}
const ci = require('miniprogram-ci')
; (async () => {
const project = new ci.Project({
appid: '********',
type: 'miniProgram',
projectPath: process.cwd() + '/dist/build/mp-wx-zsjfw',
privateKeyPath: process.cwd() + '/private.zsjfw.wx.key',
ignores: ['node_modules/**/*','images/**/*'],
})
ci.preview({
project,
desc: 'hello',
setting: {
urlCheck: false,
es6: true,
minify: true,
},
libVersion: "2.25.4",
qrcodeFormat: 'image',
qrcodeOutputDest: process.cwd() + `/test.jpg`,
onProgressUpdate: console.log,
}).then(res => {
console.log(res)
}).catch(error => {
console.log(error)
process.exit(-1)
})
})()
所有不在分包里的代码都算到主包里 看下是不是超了
已解决,问题的原因是:IDE预览有个这个配置:bigPackageSizeSupport。设置预览包的大小,默认是4M,而cli没有配置,默认是2M