收藏
回答

miniprogram-ci分包后仍然报超出大小?

小程序开启了分包,微信开发者工具中显示主包大小为1570K

但是在使用miniprogram-ci工具上传时,仍然报超出2M,显示主包大小为2202K,感觉是把分包给算到主包里面去了。

[14:51:55] request url: https://servicewechat.com/wxa/ci/upload?codeprotect=0&type=miniProgram&appid=wxe1fb678db84d5481&version=99.99.99&desc=%E5%86%85%E9%83%A8%E6%B5%8B%E8%AF%95%E7%89%88%E6%9C%AC&robot=1&debugLaunchInfo=%7B%22scene%22%3A1011%7D
[14:51:5720003 Error: {"errCode":-1,"errMsg":"inner upload fail with errcode: 80200, errmsg: main package source size 2202KB exceed max limit 2MB"}
[14:51:57Error: Error: {"errCode":-1,"errMsg":"inner upload fail with errcode: 80200, errmsg: main package source size 2202KB exceed max limit 2MB"}
[14:51:57]     at upload (/root/workspace/denghan_tpyx-welfare-mp_lyhL/node_modules/miniprogram-ci/dist/upload/upload.js:1:3963)
[14:51:57]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[14:51:57]     at async Object.upload (/root/workspace/denghan_tpyx-welfare-mp_lyhL/node_modules/miniprogram-ci/dist/utils/report.js:1:1399) {
[14:51:57]   code: 20003
[14:51:57] }
[14:51:57] 上传失败


miniprogram-ci版本号为1.2.3

上传脚本配置如下

const ci = require('miniprogram-ci')
let { appId } = require('../package.json').deploy

let version = '99.99.99'
let desc = '内部测试版本'

const project = new ci.Project({
  appid: appId,
  type: 'miniProgram',
  projectPath: process.cwd() + '/dist/dev/mp-weixin',
  privateKeyPath: process.cwd() + '/deploy/private.key',
  ignores: ['node_modules/**/*'],
})
ci.upload({
  project,
  version,
  desc,
  setting: {
    es6: true,
    minify: true,
    minifyJS: true,
    minifyWXML: true,
    minifyWXSS: true,
  },
  robot: 1
}).then(res => {
  console.log(res)
  console.log('上传成功')
}).catch(error => {
  if (error.errCode == -1) {
    console.log('上传成功')
  }
  console.log(error)
  console.log('上传失败')
  process.exit(-1)
})
回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容